Reaction lab
Variables, sensing, and a score
Read the chapter and learn the ideas
See what you will learn, study the ideas, then take the concept check.
Learn how games remember score and state — so timing, false starts, and game over feel fair, not random.
What you will learn in this chapter
Variables
VariablesScore, timer, round, and gameState store numbers that change while you play.
Conditionals
Control · Operatorsif / else decides what happens when the player presses too early or at the right moment.
Sensing
SensingKeyboard and mouse blocks detect player input during each round.
State machine
Variables · ControlgameState groups logic into modes: waiting, signal live, result, game over.
Fair randomness
Operators · ControlRandom delay adds suspense; guard rules make sure only valid presses score.
After this chapter you can
- Track score and rounds with variables shown on the stage
- Handle false starts separately from valid reactions
- End a round and replay with a clean reset
Study the ideas
This chapter turns Scratch into a science lab. You are building a game that measures attention, timing, and reaction under pressure.
Most beginner reaction games stop at one script and one score. Yours will be richer: a countdown, random signal timing, valid/invalid input states, score updates, and a clean replay loop.
Sketch first
State-driven design
gameState keeps your logic honest. Instead of guessing what should happen, your scripts ask: what state are we in right now?Check yourself before the quiz
- What role does
gameStateplay in preventing invalid scoring? - How do guard conditions improve fairness in reaction games?
- Why should replay use the same reset logic as green flag?
- What is one debugging method you used when behavior looked inconsistent?
- How does random delay add challenge without reducing clarity?
Pass the concept check
So you know you are ready to build the chapter lab.
Build the chapter lab
Build what the manual describes in Step 1.
The chapter lab unlocks after you pass the concept check
Read Step 1 and finish Step 2 first — then come back here to build in Scratch.
Back to concept checkSubmit your project
Submit when the checklist matches your project.
Submission unlocks after you pass the concept check
Finish Steps 1–3 first — read the manual, pass the quiz, then build the lab.
Back to concept check