Skip to content

Instantly share code, notes, and snippets.

@gak
Last active December 17, 2015 22:39
Show Gist options
  • Save gak/5683113 to your computer and use it in GitHub Desktop.
Save gak/5683113 to your computer and use it in GitHub Desktop.
Example Mousetrap code for the blog post:http://geraldkaszuba.com/red-panda-mini-game/
Mousetrap.bind('space', function(e) { e.preventDefault(); player.shoot(true) }, 'keydown')
Mousetrap.bind('space', function(e) { e.preventDefault(); player.shoot(false) }, 'keyup')
Mousetrap.bind('i d d q d', function() {
console.log("God Mode enabled!")
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment