Last active
February 6, 2020 08:59
-
-
Save worldoptimizer/ebc05606ccf28ba611af0907466a2279 to your computer and use it in GitHub Desktop.
Function initGame (Keyboard Input, Lander Game))
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
var keyPressLookup = {}; | |
document.addEventListener('keydown', function(e){ | |
keyPressLookup[e.code] = true; | |
}); | |
document.addEventListener('keyup', function(e){ | |
delete keyPressLookup[e.code]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment