Implement the Konami Keystroke Cheat Code in a Unity Game

The Polyglot Developer Guide 4 years ago

Description

If you've ever wanted to include keystroke based cheat codes in your game that was built with Unity, this is the tutorial for you!

Think Konami where you have the "Up, Up, Down, Down, Left, Right, Left, Right, B, A" series of keystrokes that give you unlimited lives, more speed, or other useful assistance. To do this you need to capture and track the keystrokes as they happen and make sense of them later.

This tutorial looks at a few approaches which include `OnGUI` as well as looping through available key codes within Unity.

#unity #gamedev #konami

You can find a written version of this tutorial on my website at https://www.thepolyglotdeveloper.com/2021/09/implement-konami-keystroke-cheat-code-unity-game/