Skip to content

Instantly share code, notes, and snippets.

@MikeShi42
Created August 13, 2018 17:42
Show Gist options
  • Save MikeShi42/6df86a01177def1da028220b96db6e16 to your computer and use it in GitHub Desktop.
Save MikeShi42/6df86a01177def1da028220b96db6e16 to your computer and use it in GitHub Desktop.
constructor(socket, remotePlayer, size, InputManager, Actuator, StorageManager) {
...
// Add these two lines
this.remotePlayer = remotePlayer;
this.socket = socket;
// Add this new if statement
if (this.remotePlayer) {
this.socket.on('move', this.handleRemoteMove.bind(this));
}
this.setup();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment