anbenson / interceptor

collaborative maze with intercepted communication
http://interceptr.herokuapp.com
0 stars 0 forks source link

Interceptor

A maze-like puzzle for two parties, with some unexpected twists. For 15-112.

Built on node.js, express, and socket.io. Why express? Why not?

Prerequisites

Installation

API

Before you do anything, register yourself.

socket.emit("register", teamname, password, isPlayer)

Send the register event to register yourself to the server. If successful, you'll receive the puzzleUpdate event.

Parameters:

socket.emit("move", dir)

Send the move event when you wish to move the player. You must be registered first. All move events received from the observer will be ignored. If successful, both the player and observer will receive the puzzleUpdate event.

Parameters:

socket.emit("hint", coords)

Send the hint event when you wish to send coordinates of a spot on the board where the player should go (of course, the server may intercept and modify your hint along the way). All hint events from the player will be ignored. If successful, both the player and observer will receive the puzzleUpdate event.

Parameters:

socket.on("puzzleError", function(msg){})

The puzzleError message is sent when...you cause an error. You can do what you like with the message.

Parameters:

socket.on("puzzleUpdate", function(puzzle, puzzleConfig, observerHint, answer){})

The puzzleUpdate message is sent whenever the puzzle state has changed, or whenever the server feels like it. It's best not to wonder why and to just draw the puzzle.

Parameters:

Field Type Description
playerSym string the character used to denote the player's position in the puzzle
targetSym string the character used to denote the position in the puzzle the player is trying to get to
obstacleSym string the character used to denote an obstacle in the puzzle
emptySym string the character used to denote an empty space in the puzzle
level number the level number of the puzzle
state string one of "normal", "reset", or "newLevel". describes the sent puzzle