Name
The variable name says what the value represents.
Topic Guide
A variable stores a value that can change. State records which set of rules currently applies.
Scores, timers, fuel, pet moods, and robot modes all have to be remembered. Giving each value a clear name lets a student inspect it while the project runs.
A taxi meter keeps the current fare while the vehicle moves. A game score or robot mode also stores information now so that another rule can use it later.
The variable name says what the value represents.
The project sets a known value before the test begins.
A particular event changes the value.
A label such as PLAYING, CAUGHT, or DELIVERING selects the current rules.
Add one when an action finishes, rather than on every frame.
Store a changing need and let it affect the pet's behaviour.
Use STARTING, PLAYING, WON, and LOST to control separate rules.
Record whether the machine is waiting, moving, or recovering.
Program connections
Students author games, animations, simulations, and strange interactive stories while learning how events, rules, and state fit together.
Students write commands, wire simple circuits, read sensors, and trace physical cause and effect through the Sense–Decide–Act loop.
A possible later step from visual programming into Lua, 3D objects, events, and larger game rules.
A possible later program for testing patterns, predictions, prompts, mistakes, and the limits of AI tools.
A new game inherits the score or mode from the previous run.
The score jumps because more than one rule changes it.
Variables called thing or number make the code harder to read.
Removing a variable monitor from the stage does not erase its value.
Create a virtual pet with needs that change over time and actions that affect more than one value.
See how it worksNavigate a space taxi between coordinate-based pickups and destinations.
See how it worksBuild a reaction timer with a random delay, an early-press rule, and results in the correct units.
See how it works