Hello, coding friends! Ready to add some sparkle to your game library? This tutorial guides you through creating a magical Christmas Fairy catch game—an excellent ScratchJr project for learning movement, continuous falling, and implementing a specific winning condition!
In this ScratchJr game, you’ll control a fairy who must collect pieces of falling holly, with the ultimate goal of catching the special ‘Golden Holly’ to win the game!
Step 1: Design Your Fairy, Holly, and Scene
First, let’s set the stage for our magical game.
- Select Your Fairy: Start a new project by deleting the cat and adding the Fairy sprite (
[00:00:20]). Make her small enough to move easily around the screen ([00:00:27]). - Set the Background: Choose an indoor scene (like the fireplace room) and use the paint tools to customize it, perhaps by removing unnecessary elements (
[00:00:30]). - Create Collectibles (Holly): Design a sprite for the Holly, complete with red berries and green leaves (
[00:00:44]). Duplicate this sprite multiple times, positioning them at the top of the screen ([00:01:28]). - The Golden Holly: Create one special piece of Golden Holly. This one is crucial, as catching it wins the game! (
[00:01:44]).
Step 2: Coding the Falling Holly and Staggered Start
The main challenge is coding the holly pieces to fall consistently but starting at different times.
The code for the regular holly pieces follows this structure:
- Continuous Falling: Use the
green flagstart block, followed by ashowblock. Add arepeatblock (e.g., 5 times) containing themove downblock (set to 15 steps, or the full height of the screen) ([00:02:28]). This ensures the holly continuously drops. - Staggered Start: To prevent them from all falling at once, you must insert a
waitblock after theshowblock. Use increasing delays for each piece (e.g., 10, 20, 30 tenths of a second) to ensure a steady, staggered flow of items ([00:03:03]). - Collection and Disappearance: Use the
bumpblock. When the holly touches the Fairy, it musthideandstopthe code for that individual sprite ([00:03:46]).
The Winning Condition
- Code the Golden Holly: For the special golden holly, use the same falling code, but change the collision action: when this holly is touched, use the
go to page 2block ([00:05:05]). - The Win Screen: Create a second page displaying your Fairy sprite and a “Merry Christmas” message (
[00:04:06]).
Step 3: Giving the Fairy Controls
You need simple left and right controls for the Fairy to catch the falling holly.
- Create Control Buttons: Design two button sprites, one for Left (blue) and one for Right (red) (
[00:05:27]). - Send Messages: Code the buttons to send a unique message when tapped (Blue message for left, Red message for right) (
[00:05:58]). - Receive and Move: Go back to the Fairy sprite. Use the
receive messageblocks:- Blue message: Triggers the
move leftblock ([00:06:13]). - Red message: Triggers the
move rightblock ([00:06:18]).
- Blue message: Triggers the
This ScratchJr project is a wonderful exercise in controlling multiple moving parts and creating a clear goal for the player. Test your coordination and try to catch that magical Golden Holly!
Ready to tackle more holiday coding fun? You can find a whole sleigh-load of exciting new Christmas coding projects to try next or here is yesterday’s Xmas ScratchJr 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 reply to Collect the Christmas Trees! Code a Gingerbread Man ScratchJr Project with a Timer! – Mr Vullo – Alternative Education Cancel reply