Install MyHighschool on your device for quick access

Add to Home Screen (iPhone & iPad)

  1. Tap the Share button (square with an arrow pointing up).
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add to confirm.

Install or add to your home screen

This browser does not support the automatic install banner. Open the menu (often or ) and look for Install, Add app, or Add to Home Screen.

MyHighschool

Your high school study companion.


Chapter 3

Reaction lab

Variables, sensing, and a score

Step 1

Read the chapter and learn the ideas

See what you will learn, study the ideas, then take the concept check.

5 concepts ~2 study pages ~5 min read

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

Variables

Score, timer, round, and gameState store numbers that change while you play.

Conditionals

Control · Operators

if / else decides what happens when the player presses too early or at the right moment.

Sensing

Sensing

Keyboard and mouse blocks detect player input during each round.

State machine

Variables · Control

gameState groups logic into modes: waiting, signal live, result, game over.

Fair randomness

Operators · Control

Random delay adds suspense; guard rules make sure only valid presses score.

Later, in Step 3, you will build: A polished reaction challenge with fair timing, score logic, false-start handling, and replay flow.

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
Read the sections below, then take the concept check in Step 2 — it asks about the ideas above, not Scratch building yet.

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.

Studio Cat: Studio Cat says: random delay creates suspense. Random delay plus fair rules creates trust. Players forgive losses, but they do not forgive unfair games.

Sketch first

Sketch a flow map with six states: Intro -> Ready -> Waiting Random Delay -> Signal Live -> Round Result -> Final Score + Replay. Write one sentence per state.

State-driven design

A variable like 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

  1. What role does gameState play in preventing invalid scoring?
  2. How do guard conditions improve fairness in reaction games?
  3. Why should replay use the same reset logic as green flag?
  4. What is one debugging method you used when behavior looked inconsistent?
  5. How does random delay add challenge without reducing clarity?
Full printable manual (PDF)
Open PDF in new tab
Step 2

Pass the concept check

So you know you are ready to build the chapter lab.

1. Variables are useful for…

2. if / else blocks are in…

3. Sensing blocks can detect key presses.

4. A game over state should…

5. To change a variable's value you use…

6. Operators can compare two numbers (e.g. score > 10).

Step 3

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 check
Step 4

Submit 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

Confirm action