Last active
April 4, 2020 01:02
-
-
Save beardhatcode/6348825 to your computer and use it in GitHub Desktop.
Do KONAMI
up up down down left right left right b a
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
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