Created
November 20, 2017 07:46
-
-
Save writingdeveloper/242aa9f8d965994a8aa253150c0b4910 to your computer and use it in GitHub Desktop.
This file contains 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
// This listens for key presses and sends the keys to your | |
// Player.handleInput() method. You don't need to modify this. | |
document.addEventListener('keyup', function(e) { | |
var allowedKeys = { | |
37: 'left', | |
38: 'up', | |
39: 'right', | |
40: 'down' | |
}; | |
player.handleInput(allowedKeys[e.keyCode]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment