Hello there, coding champions! Looking for a sweet new challenge to get you into the Christmas spirit? This ScratchJr project shows you how to make a charming and fast-paced Gingerbread Man catch game! You’ll learn essential coding techniques like creating custom characters, managing multiple falling sprites, and setting up a clear win condition.
This is a fantastic beginner ScratchJr game that allows you to flex your creative muscles while mastering movement and timing blocks!
Step 1: Design Your Gingerbread Man and Scene
Every great game starts with a great character. In this tutorial, you’ll custom-design your hero!
- Create the Gingerbread Man: Using the paint editor, you’ll build your Gingerbread Man sprite from basic shapes, colouring him brown and adding fun details like buttons (in blue and yellow) and a smile (
[00:00:19]). Adjust his size and place him on the screen ([00:02:33]). - Set the Scene: The video suggests choosing the North Pole background to give your game a frosty, festive setting (
[00:02:43]). - Create Collectibles: Design your main collectible: Stars. Create multiple star sprites, making sure to vary their size and position (
[00:02:48]). Crucially, create one special star—the Red Star—which acts as the winning item ([00:04:00]).
Step 2: Coding the Falling Stars and Timing
The stars are the items the Gingerbread Man must catch. To make the game challenging, they need to fall continuously and start at different times.
The code for each star requires three main actions:
- Continuous Falling: Use the
green flagstart block, followed by aforeverblock containing themove downblock (e.g., set to 20 steps) ([00:04:43]). This ensures the star repeatedly falls from the top of the screen. - Staggered Start: To stop all the stars falling at once, add a
waitblock after theshowblock. Set a different delay for each star (e.g., 10, 20, 30, and 40 tenths of a second) to ensure a steady, staggered flow of items ([00:05:05]). - Collection and Disappearance: Use the
bumpblock. When the star touches the Gingerbread Man, it musthideandstop([00:04:51],[00:08:20]).
The Winning Condition
For the special Red Star, you’ll use the same code, but the end action is different: when this star is touched, it uses the go to page 2 block ([00:06:29]). Page 2 simply shows a “Merry Christmas” screen, signalling the player has won!
Step 3: Giving the Gingerbread Man Controls
Your hero needs to be able to move to catch the stars! You’ll create simple directional buttons for movement.
- Create Control Buttons: Design two buttons, one for Right (red) and one for Left (green) (
[00:06:54]). - Send Messages: Code the buttons to send a unique message when tapped (Red message for right, Green message for left) (
[00:07:31]). - Receive and Move: Go back to the Gingerbread Man sprite. Use the
receive messageblocks (green and red) to trigger the correspondingmove leftormove rightblocks ([00:07:47]).
Once the code is in place, you’ll have a fantastic, fully-functional ScratchJr project where you must control your Gingerbread Man to catch all the falling stars before the Red Star appears!
Ready to take on more holiday coding fun? You can find a whole sleigh-load of exciting new Christmas coding projects to try next, and here is yesterday’s ScratchJr Christmas Project in case you missed it.
Alternatively, if you are looking for Coding Tutor in Hertfordshire to support your children with this, I can also help.
Leave a comment