Skip to content

Instantly share code, notes, and snippets.

@worldoptimizer
Last active February 6, 2020 08:59
Show Gist options
  • Save worldoptimizer/ebc05606ccf28ba611af0907466a2279 to your computer and use it in GitHub Desktop.
Save worldoptimizer/ebc05606ccf28ba611af0907466a2279 to your computer and use it in GitHub Desktop.
Function initGame (Keyboard Input, Lander Game))
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