set mood to 5initialize memory
Public lesson / Scratch & Game Design
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
Name the problem before opening the build.
Make the hidden rule visible with small tests.
Use the idea inside a working project system.
Change one rule and predict the effect.
Explain the result, save safely, and leave a known state.
Learning goals
Theory kernel
set mood to 5initialize memory
change mood by -1update over time
if mood < 2make a decision from memory
set game_state to PLAYINGname the current mode
Guided-build preview
Care for an alien pet that may be hungry, tired, delighted, or deeply suspicious of the snack button.
At least two changing needs, Actions that affect those needs, Visible mood or state, Time-based change.
Variables, State, Events, Conditions, Timers.
A working version, one modification, one repaired problem, and an explanation.
Teacher checkpoints
Common mistakes
Modification challenge
Higher levels are optional. They deepen the current idea rather than turning a beginner lesson into an unrelated advanced task.
End-of-class demonstration