Ibnovate Course 1 · The Young Builders
⏱ 60 minLive session · ages 8–11

Session 16 — Score & Loops

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

Session goal: by the end, students can create a score variable, use a forever loop to keep the game alive, and use broadcasts so sprites can talk to each other.

Before class — prep (5 min)

Agenda

Time Segment
0:00 Hook — how does a game keep score? (5 min)
0:05 Teach — variables hold a number (12 min)
0:17 Teach — forever loops and broadcasts (13 min)
0:30 Activity — build a score + a falling sprite (20 min)
0:50 Check for understanding (7 min)
0:57 Wrap-up + homework (3 min)

0:00 · Hook (5 min)

Ask the class and take a few answers (chat or unmute):

Let them guess, then reveal: today you learn three superpowers — a variable to remember the score, a loop to keep the game running forever, and a broadcast so your sprites can send each other messages.


0:05 · Teach — Variables hold a number (12 min)

Explain, on your shared Scratch screen:

Demo in Scratch:

⚠ Watch for the mix-up between set and change: set Score to 0 replaces the number; change Score by 1 adds to it. If students use set Score to 1 every press, the score gets stuck at 1. Show this on purpose so they see the difference.

Ask: "At the start of a game, should we set Score to 0 or change Score by 0? Why?" (Answer: set to 0 — we want it to become zero, not just add nothing.)


0:17 · Teach — Forever loops and broadcasts (13 min)

Explain: a game never stops checking things — it does the same job over and over. That's a loop. The forever block (yellow, Control) repeats everything inside it, endlessly.

Share this diagram so students can picture the game loop — when the flag is clicked, a forever loop keeps moving sprites, checking collisions, and updating the score:

Diagram of a game loop: a green-flag start leads into a forever loop drawn as a circular arrow, and inside the loop three repeating steps run over and over — move the sprites, check for collisions, and update the score

Demo in Scratch, building live:

Now broadcasts — how sprites talk to each other:

Key point to land: a variable remembers, a loop repeats, and a broadcast lets sprites send messages to each other.

Ask the class: "If I take the change y by -5 out of the forever loop and just leave it on its own, how many times does the apple move?" (Answer: once.)


0:30 · Activity (20 min)

Students build their own "catch" starter. Screen-share your version as a reference.

Build this, step by step:

  1. Make a variable called Score (Variables → Make a Variable).
  2. On the main sprite: when green flag clickedset [Score] to 0.
  3. Add a second sprite (apple, ball, star).
  4. On the second sprite: when green flag clickedforeverchange y by -5.
  5. Inside the same forever loop, add if y < -150 thenset y to 150 (so it loops back to the top). If if/then is new, just use set y to 150 after a few seconds for now.
  6. On the main sprite: when [space] key pressedchange [Score] by 1 and broadcast [caught].
  7. On the second sprite: when I receive [caught]go to x: 0 y: 150 and play sound [Pop].
  8. Click the green flag and test: the apple falls, space adds to the score and resets the apple.

Circulate for: - A score that jumps straight to 1 and sticks — they used set Score to 1 instead of change Score by 1. - A forever loop that "freezes" the editor — usually there's a forever with nothing that lets the screen update; adding a wait 0.1 seconds inside helps, or they simply need to click the flag to start it. - Broadcasts that don't fire — the message name in broadcast and when I receive must match exactly (check the dropdown).

Encourage: ask students to change the falling speed (change y by -5-8) and notice the game gets harder.


0:50 · Check for understanding (7 min)

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

  1. What is a variable, and what would you use one for in a game? → A box that remembers a number; use it for a score, a timer, lives, or a level number.
  2. What does a forever loop do? → It repeats the blocks inside it endlessly, so the game keeps checking or moving without stopping.
  3. How can one sprite tell another sprite that something happened? → With a broadcast — one sprite broadcasts a message, another runs when I receive that message.

0:57 · Wrap-up + homework (3 min)


Teaching notes

Practice set

Assign in class or as homework. Answers are for you, after the arrow.

  1. Make a variable called Score and set it to 0 when the green flag is clicked. → Variables → Make a Variable → name it Score; then when green flag clickedset [Score] to 0.
  2. Make the score go up by 1 every time you press the space bar.when [space] key pressedchange [Score] by 1. (Use change, not set.)
  3. Make a sprite fall down the screen forever.when green flag clickedforeverchange y by -5.
  4. When the falling sprite reaches the bottom, send it back to the top. → Inside the loop: if y < -150 thenset y to 150 (or go to x: 0 y: 150).
  5. Make one sprite send a message and another sprite react to it. → Sprite A: broadcast [caught]. Sprite B: when I receive [caught] → do something (play a sound, hide, reset position).
  6. Add a second variable called Lives, start it at 3, and lower it by 1 on a key press. → Make Lives; set [Lives] to 3 at start; when [key] pressedchange [Lives] by -1.

Going deeper (optional)

Common mistakes & fixes

Vocabulary

Term Meaning
Variable A box that remembers a number, like a score
Set Put an exact value into a variable (replaces it)
Change Add to (or subtract from) a variable
Loop Blocks that repeat; forever repeats endlessly
Broadcast A message one sprite sends and others can receive

Resources

Next session

Session 17 — Levels & Challenge: students add if/then decisions, detect when sprites are touching, and build real win and lose conditions to make the game harder.

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.
🔒