How to Use the Pop Block and Wait Block

Ready to bring your ScratchJr animations to life with sound? Today, we’re focusing on two essential blocks: the Pop block (the easiest way to add sound) and the Wait block (for perfect timing). By combining these, you can create sudden, surprising sound effects that match your on-screen actions.

Our project today will demonstrate this by animating a rabbit brought into the classroom for a ‘Show and Tell.’ We will make the rabbit disappear and reappear, synchronising the action with a fun “pop” sound. This teaches children about multitasking in coding, as we run two programmes simultaneously.

Setting Up Your Programme

First, let’s get our scene ready for the big reveal:

  1. Change the Background: Choose the classroom background. [00:27]
  2. Add the Character: Add the Rabbit character to the scene. [00:33]
  3. Adjust Size (Optional): If the rabbit is too big, you can use the Shrink block (from the purple category) outside of your main script to resize the character before coding begins. Note: This shrink action does not affect the programme itself. [00:41]

We will be creating two separate scripts for the Rabbit character, both starting with the Green Flag.

Program 1: The Visual Reveal Sequence

This script controls when the rabbit disappears and reappears using the Hide, Wait, and Show ScratchJr blocks:

  1. Start and Hide: Begin the script with the Green Flag trigger. Immediately follow this with the Hide block (purple category) to make the rabbit disappear when the programme starts. [01:05]
  2. Wait for the Reveal: Add the Wait block (orange category). This block pauses the script for a defined number of tenths of a second. The video uses the default 10 (meaning one second). [01:17]
  3. The Reveal: After the pause, add the Show block (purple category) to make the rabbit reappear. [01:23]
  4. End: Finish the script with the red End block.

Program 2: Synchronising the Sound Effect

This script runs at the same time as the first one and is designed to play the “pop” sound exactly when the rabbit disappears and reappears.

  1. Second Start Block: Start a new, separate script with a second Green Flag block. This is vital for running two programmes simultaneously. [01:32]
  2. Initial Pop: Add the Pop block (green category). This sound will play immediately when the Green Flag is pressed, perfectly matching the rabbit disappearing (from Program 1). [01:40]
  3. Synchronised Wait: Add a Wait block (orange category) and set it to the same value as the other script (10). This keeps the two programmes synchronised. [01:48]
  4. Final Pop: Add a second Pop block. This sound will play just as the rabbit reappears (from Program 1). [01:51]
  5. End: Finish this script with the red End block.

When you press the Green Flag, the rabbit will disappear and you’ll hear a pop. It will wait for one second, and then the rabbit will reappear with a second pop! [02:16]

Mastering these techniques is a fantastic way to upgrade your coding tutorials. For more structured coding activities that build on timing and sequencing, please explore our collection of ready-made lessons. Happy coding!