Skip to content

Instantly share code, notes, and snippets.

@MikeShi42
Created August 13, 2018 17:27
Show Gist options
  • Save MikeShi42/ac78496a3af1fe9d47d3368a52d56924 to your computer and use it in GitHub Desktop.
Save MikeShi42/ac78496a3af1fe9d47d3368a52d56924 to your computer and use it in GitHub Desktop.
socket.on('actuate', function (data) {
const { grid, metadata } = data; // Get grid and metadata properties from client
const move = {
playerIndex,
grid,
metadata,
};
// Emit the move to all other clients
socket.broadcast.emit('move', move);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment