Learn how to use the Makey Makey extension in Scratch 3 to create a secret code game.
Step 1: Design a Scratch Game With a Secret Code Concept
Scratch 3.0 features a Makey Makey extension that allows you to create a program/game with a secret code. Eric Rosenbaum was inspired to make this extension from classic video games by Konami that often had secret codes to unlock extra lives, special powers, etc. The code varies, but generally includes using a combination of arrow keys.
Your mission, should you choose to accept it, is to create a game with a secret code that unlocks hidden items in Scratch.
For our example game, we've included a physical puzzle solving element to figuring out the secret code. (Think Breakout Edu style!)
Decipher the code, feed the bear, and then design and create your own game!
Step 2: Use the Makey Makey Extension
In Scratch 3.0, click on Extensions and add the Makey Makey extension to your current project. After you add the extension, you'll see the Makey Makey logo beneath "My blocks."
There are multiple options here for secret codes. Including the original Konami code of:
up up down down left right left right
If you are happy with these codes, pick one and skip to the next step. If you want to make your own code, proceed to step 3.
Step 3: Optional- Make Your Own Variable
In the variable palette, create a variable for your secret code. Drag a "Set variable to____" to your workspace and connect it to a "When Green Flag Clicked" block (Picture 1). Inside the blank, type the code you want to be your secret code. For our game, we used "left up right down right up left" as our secret code. Rename or delete this block by right clicking on the variable. (Picture 2)
In the next step, we will drag the "my sequence" block into the Makey Makey extension block.
Step 4: Make a Clue for Your Code
This is actually probably one of the hardest and most fun parts of this creation process! You'll have to create a riddle or puzzle to help users figure out your secret code.
For our game, the secret code is:
left up right down right up left
So we made a coded question that should lead the player to the palindrome: taco cat. Once the player figures out the word, they have to transcribe the code to match taco cat and figure out the taco code!
Now the player can make tacos appear for the hungry bear!
You can decide if you want your players to tap out the word with Play Doh like our example, or just type the correct arrow keys.
Step 5: Use Your Variable With Makey Makey Extension
Once you've created a sequence, it is really easy to drag it into the adjustable spot in the Makey Makey block: "When ____ pressed in order"
After you set this up, you are ready to test it out and create your own secret code game!
Step 6: Create Your Own Game!
After picking a background and characters, you'll have to decide what your secret code will do in your game.
In our example game, this secret code makes tacos appear randomly on the screen (Code in Picture 1.) The game's objective is for the bear to eat the tacos!
When the bear touches the taco, the costume changes and it sounds like the bear is eating the taco. (Eating Taco Code in Picture 2.)
We also created a "tacos eaten" variable to track how many tacos the bear eats. Once he eats enough tacos, the variable will signal the end of the game and trigger an eternal taco rain! (Trigger Code in Picture 3 and Taco Wizard signals you to create your own game in Picture 4.)
See the next step for raining taco code!
Step 7: Bonus: Raining Tacos?
Thanks to firefang16 for the original raining taco code!
In our game, we have the taco clone begin once the variable trigger reaches the correct number. To have a "raining taco" effect, we used this code from firefang16!
Step 8: Trigger With Makey Makey
How will you design your secret code controller?
We hooked up a drawing of a d-pad for controlling the bear, and decided to also connect our arrow keys to the word T A C O.
While you can control this game with the word TACO, you can also play the game with the arrow drawings and then tap out taco cat on the Play-Doh.
What will you create?