Skip to content

Instantly share code, notes, and snippets.

@rjriel
Created October 27, 2016 15:29
Show Gist options
  • Save rjriel/1d70c9f169c3a8556e149a6efeaca68d to your computer and use it in GitHub Desktop.
Save rjriel/1d70c9f169c3a8556e149a6efeaca68d to your computer and use it in GitHub Desktop.
MOVE PLAYED
socket.on('move played', (move) => {
// someone has played a move in our game
// if the move just played wasn't by us, it is now
// our turn to play.
if (move.player != playerId) {
console.log(`opponent performed ${move.result}`)
performMove()
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment