georgemandis / konami-js

Adding the Konami Code easter egg to your projects since 2009! Compatible with gestures on smartphones and tablets as well. Compatible with all front-end frameworks and vanilla JavaScript
http://konamijs.mand.is/
MIT License
959 stars 121 forks source link

The Konami Code never included Start, by default this shouldn't require Enter. #9

Closed abritinthebay closed 11 years ago

abritinthebay commented 11 years ago

Small bug I know, but it's true.

The original Konami Code (and the one they still use occationally) doesn't include Start. It was only thought to include start because most uses were before the "Press Start" title screen so many people just added start to Start the game.

http://en.wikipedia.org/wiki/Konami_Code

As per Gradius and Contra (and many more).

georgemandis commented 11 years ago

I thought about this for a while... and because you're a.) correct and b.) it's consistent with my goal of generally only merging things that can reduce the overall code-size, I went ahead and merged it!

Thanks :)

matthew-dean commented 10 years ago

Soooo.... I know the Konami code, but this doesn't really say anwhere what key pattern to use on desktop. It implies that one should be able to infer the matching pattern on a different device, but maybe spell it out?

georgemandis commented 10 years ago

Hi Matthew, I'm afraid I don't fully understand the question. Could you try explaining the issue another way?

The key pattern to use on desktop would be the arrow keys (←↑↓→) combined with the actual A and B keys.

georgemandis commented 10 years ago

Oh, I think I might understand.

On a mobile device you physicallyy "swipe" in those directions (up,up, down,down, etc.) with gestures. A and B are interpreted simply as "taps" because that seemed less difficult than physically "drawing" an A or B.

matthew-dean commented 10 years ago

No, I mean on desktop. Unless the demo page doesn't actually use the code? I couldn't find a working example. It also appears that the character codes are upper-case (or are a and b auto-converted?)

georgemandis commented 10 years ago

You are correct — the demo page doesn't use the code. It used to sit on a page on my site but then I moved the demo page to a GitHub page and never updated that... I'll keep it on my list of things to do.

As for character-casing, the code looks for key codes which are case-insensitive (65 & 66)