Skip to content

Instantly share code, notes, and snippets.

@MikeShi42
Created August 13, 2018 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeShi42/952728aa220d2b60a0cb26269b4f67d5 to your computer and use it in GitHub Desktop.
Save MikeShi42/952728aa220d2b60a0cb26269b4f67d5 to your computer and use it in GitHub Desktop.
class GameManager {
constructor(socket, remotePlayer, size, InputManager, Actuator, StorageManager) {
...
// Add this new if statement
if (this.remotePlayer) {
this.socket.on('move', this.handleRemoteMove.bind(this));
}
// No setup!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment