Public lesson / Scratch & Game Design

Where Does the Score Live?

A space pet insists it was fed, but the program has forgotten. What information must the game remember, when should it change, and when should a new run reset it?

Lesson rhythm

The idea moves toward a demonstration.

  1. Story, problem, or provocation

    Name the problem before opening the build.

  2. Theory and concept

    Make the hidden rule visible with small tests.

  3. Guided build

    Use the idea inside a working project system.

  4. Modification challenge

    Change one rule and predict the effect.

  5. Demonstration and cleanup

    Explain the result, save safely, and leave a known state.

Learning goals

What students should be able to do and explain.

  • Create a meaningfully named variable.
  • Set an initial value.
  • Update a value from an event.
  • Use a value in a condition.
  • Separate score, state, and visual display.

Theory kernel

Small examples before the larger build.

set mood to 5

initialize memory

change mood by -1

update over time

if mood < 2

make a decision from memory

set game_state to PLAYING

name the current mode

Guided-build preview

The Suspiciously Emotional Space Pet

Care for an alien pet that may be hungry, tired, delighted, or deeply suspicious of the snack button.

Open Guided Project
Students build

At least two changing needs, Actions that affect those needs, Visible mood or state, Time-based change.

Concepts in use

Variables, State, Events, Conditions, Timers.

Finish line

A working version, one modification, one repaired problem, and an explanation.

Teacher checkpoints

Evidence before adding complexity.

  1. 1Variable name describes its purpose.
  2. 2Restart restores the initial value.
  3. 3One event changes the value once.
  4. 4A condition reads the value.
  5. 5Student explains the current state.

Common mistakes

Pause, inspect, and test one cause.

  • Variable never resets.
  • Several scripts change the score unexpectedly.
  • A display is hidden but the value remains.
  • Text and number values are compared accidentally.

Modification challenge

Three levels, one concept kept visible.

Higher levels are optional. They deepen the current idea rather than turning a beginner lesson into an unrelated advanced task.

LEVEL 1

Builder

  • Add a second need such as energy.
LEVEL 2

Inventor

  • Make needs affect each other.
LEVEL 3

Boss Level

  • Create named pet states from several variables.

End-of-class demonstration

Explain the work while it is still visible.

  1. What does the variable remember?
  2. Where is it initialized?
  3. Which event changes it?
  4. Which decision reads it?
  5. What state is active now?