Are you ready to add some suspense and “magic” to your child’s coding projects? Today, we’re going to master three essential ScratchJr blocks that work together to create animated effects: the Hide block, the Wait block, and the Show block. These are perfect for making characters or objects disappear and reappear exactly when you want them to!
Our project will demonstrate this by having Kitten walk up to a whiteboard to solve a maths problem, with the answer magically appearing moments later. This teaches children about timing, sequencing, and using conditional appearance in their programmes.
Setting Up the Custom Scene
Before we code, we need to personalise our scene and create a special character.
Customising the Background
We need to add a calculation to the classroom whiteboard.
- Select and Edit: Choose the classroom background, but instead of pressing the tick right away, click the paintbrush icon to open the editing window. [00:35]
- Draw the Problem: Use the drawing tools to write a simple equation on the whiteboard, like “2 + 3 =”. Use the line tool and a thin brush setting for neatness. [00:52]
- Save: Press the tick button to save your customised background. [01:20]
Creating the Answer Character
Since there is no number ‘5’ character, we need to create it!
- New Character: Click the ‘Add Character’ button (the plus sign) but instead of choosing a library character, select the empty screen in the top-left corner. [01:32]
- Draw the Number: Click the paintbrush icon again. Using the drawing tools, carefully draw the number 5 (or whatever the answer is). [01:45]
- Position: Save the new character and position it on the whiteboard, right after the ‘equals’ sign in your equation. [02:07]
Coding the Sequence
We need two separate scripts to make this work: one for Kitten’s action and one for the number’s appearance.
Coding Kitten’s Movement
Kitten needs to walk towards the whiteboard first.
- Select Kitten: Ensure the Kitten icon is selected.
- Movement Script: Start with the Green Flag block. Use the Move Up block from the blue category to make Kitten move upwards toward the whiteboard (e.g., set to 5 squares). [02:32]
- End: Finish the script with the red End block.
Coding the Animated Reveal
Now we code the number 5 character to be initially hidden and then appear after a delay. This script uses key ScratchJr blocks for timing.
- Initial State (Hide): Select the Number 5 icon. Start the script with the Green Flag block. Immediately follow this with the Hide block from the purple Looks category. This ensures the answer is invisible as soon as the programme starts. [03:22]
- Timing (Wait): Go to the orange Control category and add the Wait block. We need this block to hold the programme while Kitten walks to the board. Change the number to 15 (a suitable amount of time for the walk animation). [03:39]
- The Reveal (Show): After the Wait block, add the Show block from the purple Looks category. This makes the answer suddenly appear! [03:51]
- End: Finish the script with the red End block. [04:04]
When you press the Green Flag, Kitten will walk to the board, and after a moment of waiting, the answer will pop into place—a perfect use of sequenced timing!
This project is a great example for our coding tutorials on how timing and visibility can enhance storytelling. For more structured coding activities, explore our curated lessons designed to build confidence in young coders. Happy coding!