First appeared in the video game Gradius back in May 29, 1985, the Konami Code is a set of keystrokes that when pressed in the following order will enable a cheat in the game:
The Konami code appeared in many of the video games made by the Japanese entertainment company.
- Silent Hill 3
- Teenage Mutant Ninja Turtles
- Metal Gear Rising: Revengeance
In non-Konami games such as:
- Assassin’s Creed III (Ubisoft Montreal)
- Half-Life 2 (Valve Corporation)
- Plants vs. Zombies (PopCap)
- Resident Evil 2 (Capcom)
And in movies, like Wreck-It Ralph:
But that’s not all, this code can also be added to your website:
- Reddit (Must have the RES Extension installed)
- And of course, here at News47ell. Duh.
Now buckle up, because the game is about to begin.
Let’s dive right in:
# Step 1:
Create a set of folders and sub-folders that look similar to the one described below and follow the same structure:
# Step 2:
Paste this code inside KonamiCodePlugin.php:
# Step 3:
Paste this code inside KonamiCode.js:
.Zip the KonamiCodePlugin folder and upload it to your WordPress site as a new plugin. You should be good to go with your very own, brand new Konami Code easter egg.
If you want, you can just copy the JS code from step 3, and paste it inside the Simple Custom CSS JS WordPress plugin which I reviewed before.
# Let’s break the last 5 lines of the code:
The easter eggs lay from line 37 to 43 or in other words, the things that will be triggered once you finish pressing the required keys.
The code above does 3 things:
- Change the
- Plays an
- Show an
alertwith a message
If you want the easter egg 1 and 2, you have to specify the URL in the code in step 3 for the image and the audio file.
You can remove any of these lines to remove their function and add more if you want as well.
That was fun, right?
The idea for this article all started when I was reading the source code of the site MacStories and in their core.js file, I noticed a Konami Code reference after I un-minified the file. I decided to give it a shot. Voilà!
Have fun implementing it on your site.