Introduction
In this exciting ScratchJr project, we are going to code a custom Hulk character that can smash through walls of rocks! Your child will learn how to use trigger blocks (bumps), message sending, and sequencing to create a satisfying destruction effect. We will programme the Hulk to walk up to a wall, “battle” the rocks, and watch them shatter and disappear. Finally, we’ll add a fun victory animation where the Hulk grows giant and celebrates. It is a fantastic way to master cause-and-effect logic in ScratchJr.
The Video Embed
What You Need
- Characters:
- Hulk: We modify the standard ScratchJr Cat (paint him green, give him purple trousers and hair).
- Rocks: You will need 7 rock/block characters in total (4 Light Grey, 3 Dark Grey).
- Controllers: An Orange Square (Left button) and a Red Square (Right button).
- Background: A city street or a rocky landscape works best for a smashing game.
Step-by-Step Instructions
Step 1: Create the Hulk Character
First, open the Paint Editor on the Cat character. Use the paint bucket to turn his skin green and draw some purple trousers.
- The Movement: We aren’t using the standard blue arrow blocks directly on the Hulk. Instead, we will use “Messages” from our controller buttons to keep the screen tidy.
- Code for Hulk: On Orange Message, Move Left. On Red Message, Move Right.
- Battle Effect: Add a script so that when Hulk Bumps into a rock, he does a small Shake (move right then left quickly) to look like he is hitting it.
Step 2: The Controls (Joypad)
Create two new characters: an Orange Square and a Red Square. Place them at the bottom of the screen.
- Left Button (Orange): Start on Tap -> Send Orange Message.
- Right Button (Red): Start on Tap -> Send Red Message. (Tip: This creates a simple controller so your fingers don’t block the action!)
Step 3: The First Wall (Light Grey Rocks)
Arrange 4 light grey blocks to form a wall. One of these will be the “Trigger” block that controls the others.
- The Trigger Block: Start on Bump (when Hulk touches it) -> Send Yellow Message -> Shake -> Wait -> Move (to look like it’s flying away) -> Disappear.
- The Other 3 Blocks: Start on Yellow Message -> Wait (set timer to 10) -> Fade/Pop (use the Starburst block).[Insert screenshot of the Yellow Message code blocks here]
Step 4: The Second Wall (Dark Grey Rocks)
Place 3 dark grey blocks behind the first wall.
- The Trigger Block: Start on Bump -> Send Green Message -> Shake -> Wait -> Move -> Disappear.
- The Other Blocks: Start on Green Message -> Wait -> Fade/Pop. Crucially, on the final dark rock, add a Blue Message at the very end of its script to trigger the game over screen.
Step 5: The “Hulk Smash” Finale
Go back to your Hulk character to code the celebration.
- The Win Code: Start on Blue Message -> Grow (Size 20) -> Say “Hulk Smash!” -> Jump High -> Jump High.[Insert screenshot of the Blue Message code blocks here]
Troubleshooting/Tips
- Rocks not breaking? Check your message colours. The first wall must use Yellow messages, and the second wall must use Green. If they are mixed up, the wrong rocks will vanish!
- Hulk moving too fast? Ensure your joypad buttons only send the message once per tap, rather than looping.
- Want more rocks? You can add as many as you like, just remember to copy the “Start on Message” code to every new rock you add.
If you are interested in doing more coding with your children and pupils, please check out the other ScratchJr tutorials I have created.