Ibnovate Scratch Creators
⏱ 60 minLive session · ages 7–11

Session 9 — Catch the Falling Apples

Duration: 60 min · Format: live online · Ages: 7–11

Session goal: by the end, students have built a complete, playable catch game — a basket they steer with the arrow keys, an apple that falls from the top and respawns at a random spot, and a score that goes up by one every time they catch it.

Before class — prep (5 min)

Agenda

Time Segment
0:00 Hook — let's build a real game today (5 min)
0:05 Teach — the plan: two sprites, three rules (10 min)
0:15 Teach — steer the basket with arrow keys (8 min)
0:23 Activity — build the catch game step by step (27 min)
0:50 Check for understanding (5 min)
0:55 Wrap-up + homework (5 min)

0:00 · Hook (5 min)

Ask the class (chat or unmute):

Take two answers. Then reveal: "Today we build Catch the Falling Apples. You steer a basket, apples drop from the sky, and every apple you catch is +1. By the end of class it's a game you can send to your family tonight."


0:05 · Teach — The plan: two sprites, three rules (10 min)

Share this diagram and point to each part as you name it:

A catch game where a basket catches falling apples and the score goes up by one for each catch

Explain the plan slowly — a game is just a few simple rules running at once:

Ask: "Which rule keeps the score? Which one do we need a variable for?" (The catch rule; the variable is score.)

Make the score variable now: Variables → Make a Variable → score, check its box so it shows on the stage.


0:15 · Teach — Steer the basket with arrow keys (8 min)

Explain: to move on key presses we don't use one big loop that waits — we use a forever loop that checks the keys every moment. Build this live on the Basket sprite while they watch.

Build this together (on the Basket):

1. From Events (yellow), drag out when green flag clicked.

2. From Control (orange), snap a forever loop under it.

3. Inside the loop, add an if <> then. In its hexagon slot, drop Sensing → key [space] pressed? and change the dropdown to right arrow. Inside, put Motion → change x by (10).

4. Add a second if <> then below it for left arrow, with change x by (-10) inside.

Your Basket script now reads:

when green flag clicked
forever
  if key [right arrow] pressed? then
    change x by 10
  if key [left arrow] pressed? then
    change x by -10

Press the green flag and tap the arrow keys — the basket slides left and right. Celebrate: the player is alive!

⚠ Watch for the "one press, one step" trap: if you use when [right arrow] key pressed (an Events hat) instead of a forever + if check, the basket lurches once and stops. The forever loop is what makes it move smoothly while you hold the key.

Ask: "Why does change x by -10 move the basket left?" (Negative x = toward the left edge — that's the x–y grid from Unit 2.)


0:23 · Activity — Build the catch game step by step (27 min)

Students build the whole game. You've already done the basket together; now they add the apple's fall and catch rules. Demo each step, then let them work and circulate.

Part A — set up (do together):

  1. If they don't have them yet: delete the cat, add a Basket sprite and an Apple sprite, and make the score variable.
  2. Click the Basket and build the steer script from the Teach above (when green flag clicked → forever → twoif key pressedchecks).

Part B — make the apple fall (on the Apple sprite):

  1. Click the Apple sprite. From Events, add when green flag clicked.
  2. Set the score to zero and send the apple to the top: Variables → set [score] to (0), then Motion → go to x: (pick random -200 to 200) y: (160). (pick random is in Operators — green.)
  3. Add a forever loop. Inside it, add change y by (-5) so the apple drips downward each moment.

The Apple script so far reads:

when green flag clicked
set [score] to 0
go to x: (pick random -200 to 200) y: 160
forever
  change y by -5

Press the green flag — the apple falls straight down and disappears off the bottom. That's the bug we fix next.

Part C — reset at the bottom (inside the same forever loop):

  1. Still inside the forever, under change y by -5, add Control → if <> then. In the hexagon put Operators → ( ) < ( ), and inside it drop Motion → y position on the left and type -160 on the right, so it reads y position < -160.
  2. Inside that if, put go to x: (pick random -200 to 200) y: (160) — the apple jumps back to a new random spot at the top.

Part D — catch it! (still inside the forever loop):

  1. Add one more if <> then inside the loop. In its hexagon drop Sensing → touching [Basket]?.
  2. Inside it, add change [score] by (1) and then go to x: (pick random -200 to 200) y: (160) so a caught apple flies back to the top.

The finished Apple script reads:

when green flag clicked
set [score] to 0
go to x: (pick random -200 to 200) y: 160
forever
  change y by -5
  if y position < -160 then
    go to x: (pick random -200 to 200) y: 160
  if touching [Basket]? then
    change [score] by 1
    go to x: (pick random -200 to 200) y: 160
  1. Press the green flag and play! Steer with the arrows and catch apples — the score should climb by 1 each catch.
  2. Make it yours: speed up the fall (change y by -8), add a Sound play sound [Pop] inside the catch if, or paint a nicer basket costume.

Circulate and ask: "Show me the block that adds to your score. What happens if you make the apple fall faster?"

Debrief: ask 2–3 students to share their screen and play for the class; read their score aloud.


0:50 · Check for understanding (5 min)

Ask these aloud or in the chat. Answer key (for you):

  1. Why do the arrow-key checks go inside a forever loop? → So Scratch checks the keys over and over, letting the basket glide while you hold the key instead of moving once.
  2. Which block detects a catch, and where does it belong?touching [Basket]? (Sensing), inside an if–then in the apple's forever loop.
  3. After the score goes up, why do we send the apple back to y: 160? → So a new apple starts falling from the top — otherwise the same apple keeps touching the basket and the score races up.

0:55 · Wrap-up + homework (5 min)


Teaching notes

Vocabulary

Term Meaning
key pressed? A Sensing block that is true while a key is held down
forever A loop that repeats its blocks endlessly, so rules keep checking
touching [sprite]? A Sensing block that is true when two sprites overlap
pick random An Operator that gives a different number each time — used for a random x
Variable A named box that stores a value, like score, that can change while the game runs

Resources

Practice set

Extra tasks to sharpen the catch game. Work them easy → hard, at lab time or for homework. Answers follow each arrow.

1. Colour clue. Which block family holds touching [Basket]?? → Sensing (cyan).

2. Predict. The apple has change y by -5 but no if y position < -160 rule. What happens when you run it? → The apple falls off the bottom and never comes back — there's no rule to reset it.

3. Direction. You want a hard mode where the apple falls twice as fast. Which block do you change, and to what? → change y by (-5) → make it change y by (-10) (more negative = faster down).

4. Fix it (spot the bug). A student's score jumps from 0 to 50 in a flash on one catch. Why? → The catch if has no go to … y: 160 after change [score] by 1, so the apple keeps touching the basket every loop. Fix: send the apple back to the top inside the catch if.

5. Make it (build task). Add a rule so catching an apple also plays a sound. → Inside the if touching [Basket]? then, add Sound → play sound [Pop] next to change [score] by 1.

6. Two rules (harder). Write the pseudo-code for a miss rule: when the apple reaches the bottom, reset it and lose a point. → if y position < -160 then → change [score] by -1 → go to x: (pick random -200 to 200) y: 160.

Going deeper (optional)

Optional — for a class that has a working game and wants to know why it feels alive.

Why forever and not a big list of moves? A game needs to react right now — the instant a key is held or two sprites touch. A forever loop checks every rule many times a second, so the game responds to the player in real time. This "check everything, every frame" idea is exactly how professional game engines work under the hood.

Collision is just overlap. touching [Basket]? doesn't know about "catching" — it only knows two sprites' pictures overlap. We gave that overlap meaning by choosing to add a point. Point out that if the apple looks bigger than its picture, catches feel unfair — the block reads the costume shape, not the drawing you imagined.

Common mistakes & fixes

Next session

Session 10 — Escape the Maze: students build a maze game — steer a sprite with the arrow keys, use touching color? so walls block the player, and reach a goal that says "You win!"

Ibnovate · Build · Innovate
Type to search · Esc to close
Welcome back
Sign in to continue building.
Accounts are created by Ibnovate — ask your instructor for your login.
🔒