Skip to content

Instantly share code, notes, and snippets.

@beardhatcode
Last active April 4, 2020 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beardhatcode/6348825 to your computer and use it in GitHub Desktop.
Save beardhatcode/6348825 to your computer and use it in GitHub Desktop.
Do KONAMI up up down down left right left right b a
function(){
//Konami magic
var code=[38,38,40,40,37,39,37,39,66,65], konamiStep=0;
window.addEventListener("keydown", function(event) {
if(event.keyCode==code[konamiStep]){konamiStep++;}else{konamiStep=0;}
if(konamiStep==code.length){
//KONAMI MAGIC HERE
konamiStep=0;
}
}, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment