Editorial note: This lesson replaces an earlier AI-assisted “age-by-age” ranking with unverified statistics and claims about children’s skill development. It adapts a beginner activity from the Scratch Foundation; no product was independently tested for this article.
A first coding project works best when a learner can change something and immediately see what happens. In Scratch, a small clicker game introduces an event, a variable, a condition and a testable rule. A parent or teacher can use the steps below as a short activity, then invite the learner to invent a variation.
The project: collect points before time runs out
Open Scratch and create a new project. Choose a sprite that can be clicked. The goal: each click on the sprite earns one point while a 30-second timer is running. The Scratch Foundation’s Clicker Game tutorial offers an interactive starting point if the learner prefers to follow the editor’s prompts.
Step 1: Make the score visible
- In Variables, create a variable named Score for all sprites. Leave its display visible on the stage.
- Add when green flag clicked → set Score to 0. Click the green flag twice: the display should return to zero both times.
- On the clickable sprite, add a separate script: when this sprite clicked → change Score by 1. Click the sprite three times and check that the score reads 3.
This simple version teaches that the green flag starts a new run, while a click is a different event. A variable remembers a value that changes. The Scratch Foundation’s variables guide gives more examples.
Step 2: Add a countdown and a rule
- Create another variable, Time, for all sprites.
- Under the green-flag script, add set Time to 30, then repeat 30 containing wait 1 seconds → change Time by -1.
- Change the sprite-click script so the score increases only inside if Time > 0 then.
- Test a click while Time is positive, then wait until zero and click again. The score should stop changing.
The countdown is approximate because timing depends on the project and device. The important learning check is whether the condition prevents a late click from earning a point. If it does not, ask which script changes the score and whether the condition surrounds that block.
Step 3: Make one original change
Let the learner choose a theme and one new rule. For example, move the sprite to a random position after a valid click; add a second sprite worth two points; or end the game with a message. Make one change at a time, run it, and describe what happened. The learner can explain the rule in plain words before building it: “When I click the star while time remains, add a point and move the star.”
| Question | What it reveals |
|---|---|
| What resets when you click the green flag? | Whether a new game begins in a known state |
| What happens if you click after Time reaches zero? | Whether the condition matches the rule |
| What would change if the sprite moved before the click? | How the order of blocks affects behavior |
| Can someone else explain how to play? | Whether instructions and feedback are clear |
Help without taking over
If a learner gets stuck, ask them to predict what should happen, run the project, and point to the block responsible for the difference. Offer a small hint before rearranging blocks yourself. Scratch’s Learning Library has starter projects, cards and tutorials for a next step. A child can explore at their own pace; age alone does not dictate readiness for a particular language or tool.
For a group, avoid sharing students’ names or personal information in a public project. Educators can review the Scratch Foundation’s educator resources and account options before asking students to publish. A private or local demonstration is sufficient for this lesson.
Sources
- Scratch Foundation: Clicker Game
- Scratch Foundation: Variables and Lists
- Scratch Foundation: Learning Library
- Scratch Foundation: For Educators
A small acceptance test for the finished game
| Test | Expected result | If it fails |
|---|---|---|
| Start twice with the green flag | Score returns to 0 and Time begins at 30 | Check that both reset blocks belong to the start script. |
| Click three times while time remains | Score increases by exactly 3 | Look for duplicate click scripts or a second score-changing block. |
| Click after the countdown | Score stays unchanged | Put the score change inside the Time > 0 condition. |
| Start again after a completed game | The new run works without old points | Check initialization rather than manually changing the variable display. |
Have the learner record one failed test, the block they changed, and the result after retesting. That short record can become a learning-portfolio evidence card. A working example is useful evidence of this project; it does not prove a general learning outcome.
