🐱 Scratch for Kids · Lesson 6 of 7
Variables: score and time
Count apples, and a 30-second timer.
What is a variable?
A variable is a box with a name that holds a number (or text) that can change. In Variables (orange-red), click “Make a Variable” and name it “Score”. It appears on the stage.
Keeping score
- At the start: “set Score to 0”
- When the apple touches the basket: “change Score by 1”
- Optional: when the apple is missed, “change Score by -1”
A 30-second timer
- Make another variable: “Time”
- On the stage (or the basket): when green flag clicked → set Time to 30
- repeat until Time = 0 → wait 1 second → change Time by -1
- Then: say “Game over! Score: ” join Score → stop all
Tip
💡 The “join” block (Operators) glues text and numbers together: join “Score: ” and Score.
✏️ Practice: your turn
- Make a Score variable that goes up with each apple
- Reset the score to 0 at the start
- Add a 30-second timer
- Show “Game over” with the score at the end
🧠 Quick quiz
Answer all 4 questions correctly to mark this lesson as done.
0 of 4 correct
All lessons in Scratch for Kids
- 🚩 1. Getting started: sprite, stage and green flagOpen a project and make the cat move and talk
- 🔁 2. Loops: doing things again“repeat” and “forever” — the cat bounces between the walls
- ⌨️ 3. Keyboard controlsMove a sprite with the arrow keys
- 🎵 4. Costumes, backdrops and soundsSimple animation, a stage backdrop and a sound for each action
- 🍎 5. Conditions: “if… then”The apple falls, and if it touches the basket, something happens
- 🔢 6. Variables: score and timeCount apples, and a 30-second timer
- 🏆 7. A complete game, and sharing itFinish up, add a level and share with friends