Is there any way I could track the player's keyboard inputs (specifically, those of the arrows, B, A, and Enter) to put a Konami Code easter egg in my game? I want it to do the following.
- Track the keyboard inputs of the player while they are in the game window and follow the sequence of keys pressed
- If the player presses "up, up, down, down, left, right, left, right, B, A, Enter" in that order, display a picture, show text reading "The Code" earned! and set variable $code to 1
- If the player presses anything other than the next key in the sequence (for example, up, up, down, down, G) reset the sequence so they have to start over
I'm assuming I'll have to use Javascript for this, because I don't see any Harlowe commands that make use of the keyboard. I'm not sure if this will be possible, seeing as how the only way to input text in Harlowe that I have found requires a lengthy and complicated block of code split into two parts. Any help with this would be greatly appreciated!
- Track the keyboard inputs of the player while they are in the game window and follow the sequence of keys pressed
- If the player presses "up, up, down, down, left, right, left, right, B, A, Enter" in that order, display a picture, show text reading "The Code" earned! and set variable $code to 1
- If the player presses anything other than the next key in the sequence (for example, up, up, down, down, G) reset the sequence so they have to start over
I'm assuming I'll have to use Javascript for this, because I don't see any Harlowe commands that make use of the keyboard. I'm not sure if this will be possible, seeing as how the only way to input text in Harlowe that I have found requires a lengthy and complicated block of code split into two parts. Any help with this would be greatly appreciated!