How to use the Start on Bump and Hide Blocks: Triggering Collision

Today, we are revisiting two fundamental ScratchJr blocks to create a dynamic, interactive scene: the Start on Bump block and the Hide block. By combining these, your young coders can programme an action that is triggered only when one character touches another—an essential skill for building games and interactive stories!

Our project today involves a classroom scenario where Kitten erases the writing off the whiteboard at the end of the day.

Setting Up Your Scene and Custom Character

To begin, we need the classroom scene and a piece of writing to be erased.

Customising the Scene

  1. Change the Background: Select the classroom background. [00:34]
  2. Create Custom Character: We need to create a simple character to represent the writing. Click the ‘Add Character’ button (the plus sign) and choose the empty screen in the top-left corner. [00:43]
  3. Draw the Letter: Click the paintbrush icon to open the editor. Use the drawing tools to write a large letter, such as the letter ‘A’. [01:02]
  4. Position the Letter: Save the character and position it on the whiteboard in the scene. [01:15]

Coding Kitten: The Trigger

Kitten’s script is simple; they just need to move until they collide with the letter ‘A’. Ensure the Kitten icon is selected. [01:22]

  1. Start Block: Use the Green Flag trigger block (yellow category). [01:28]
  2. Move to Board: Use the Move Up block (blue category) to make Kitten walk up toward the whiteboard. [01:35]
  3. Set Distance: You will need to set the number of steps (e.g., 2) so that Kitten stops exactly on top of the letter ‘A’. [01:54]
  4. End: Finish the script with the red End block.

Coding the Letter ‘A’: The Reaction

This is the key script. The letter ‘A’ must be programmed to react to the collision. Ensure the ‘A’ icon is selected.

  1. Start on Bump Block: Go to the yellow category and select the Start on Bump block (the two arrows pointing towards each other). This is crucial, as it tells the script to wait until another character touches it. [02:16]
  2. Disappear: Go to the purple Looks category and add the Hide block. This is the action that occurs instantly upon contact. [02:27]
  3. End: Finish the script with the red End block.

Running the Collision Programme

When you press the Green Flag, Kitten will walk upwards, and the moment they bump the letter ‘A’, the Start on Bump block is activated, the Hide block executes, and the letter instantly vanishes, simulating the erasing of the writing! [02:44]

Using these ScratchJr blocks is a vital step in teaching cause-and-effect coding. For more creative project ideas, be sure to check out our other video tutorials. For structured curriculum and lesson plans, explore our comprehensive collection of lessons. Happy coding!