Created
August 13, 2018 17:42
-
-
Save MikeShi42/6df86a01177def1da028220b96db6e16 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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