If you ever played any platform, fighting or combat games like Contra or Mortal Combat, then you will be familiar with the special key combinations for executions or special attacks that gives you some extra power, effect, or god mode. The Konami code was one of the fist cheat code in the video gaming history, that special combination later adapted by many games.
In the age of websites, many sites also installed small easter eggs for their visitors, just for fun. See the list here.
I played a little with implementing it, and just a few rows were enough to achieve the desired effect.
var p = 0;
var order = [38,38,40,40,37,39,37,39,66,65];
document.onkeyup = function(e)
{
var key = (window.event) ? event.keyCode : e.keyCode;
p = (order[p] == key) ? ++p : 0;
if( p == order.length ) alert('Boom, secrets unlocked');
};
Minden jog fenntartva, ©2008-2010 - Készült CodeIgniter keretrendszerrel - Konami codes - Mostly Valid XHTML 1.1 - Valid CSS 2.1