Second Grade · Getting Started with Scratch Coding

Lab 4: Bump!

Teach your sprite to notice when it touches something, say a message, and go back to the start.

  1. Step 1: Make a wall

    Use your arrow-key project from Lab 3. Draw a thick wall on the backdrop in a bright color.

    Video coming soonBump into a wall and go back to the start
    1. Click the Backdrop button at the bottom right of the screen.
    2. Click the Backdrops tab at the top, then choose a paint tool.
    3. Draw a thick, bright line. Pick a color not used anywhere else.
  2. Step 2: Pick a starting spot

    Put your sprite where it should always start. Then tell Scratch to go there when the flag is clicked.

    Always start in the same spot

    when green flag clicked
    go to x: -200 y: 0

    Drag your sprite to where you want it first. Then the go to block shows that spot. Click the block to make it stick.

  3. Step 3: Notice the wall

    Add a check that happens all the time. If the sprite touches the wall color, it says Oops! and goes back.

    Bump check

    when green flag clicked
    go to x: -200 y: 0
    forever
    if touching color ( wall color ) then
    say Oops! for 1 seconds
    go to x: -200 y: 0
    1. Click Control. Add forever and an if then block inside it.
    2. Click Sensing. Drag touching color into the if.
    3. Click the color circle. Then click the eyedropper and click your wall on the Stage.
    4. Add say Oops! and go to inside the if.
    5. Press the Green Flag. Steer into the wall!
  4. Step 4: Fix problems

    If it does not work, check these.

    • Did you click the wall with the eyedropper? The colors must match exactly.
    • Is everything inside the forever block?
    • Is the go to block inside the if block?
  5. Step 5: Press H to go to the middle

    Add the H key to this project too. H sends your sprite to the middle (0, 0). The green flag still sends it to your starting spot. They are two different places!

    Press H to go to the middle

    when h key pressed
    go to x: 0 y: 0

Finished?

Great work! Pick what comes next.

For grown-ups: computational thinking in this lab

Conditionals If this, then that. The most important idea in the lab. The sprite checks something and makes a choice.

Sequence inside a condition The order of say then go to matters. Swap them and discuss.

Abstraction A color stands for "wall". Children treat everything that is that color the same way.

Grown-ups: how did this activity go? Send us feedback

For teachers

Plan about 30 to 40 minutes. Watch the video together, then let children build. Check the notes for teachers and parents for account options.

Read the full notes for teachers and parents