Curriculum topic

Variables and State

Variables give names to information that can change. State describes which situation the whole system is currently in.

Why it matters

A small idea that returns in larger systems.

Scores, health, fuel, mood, timers, current questions, and robot modes all need memory. A named value lets students inspect that memory instead of hiding it inside a complicated script.

Real-world connection

A taxi meter remembers a fare while the vehicle moves. A game score and a robot patrol mode do the same kind of work: they preserve information so later decisions can use it.

The connection shows where the idea returns; it does not claim every advanced application is taught in this first topic.

Math and logic kernel

The structure beneath the project.

Name

A useful variable name describes the information stored.

Initial value

Every test should begin from a known value.

Update

An event changes a value for a reason.

State

A label such as PLAYING, CAUGHT, or DELIVERING controls the current rules.

Small examples

Make one relationship visible at a time.

1

Score

Increase after a completed action, not every frame.

2

Pet mood

Store a changing need and show its effect.

3

Game state

Separate starting, playing, won, and lost behaviour.

4

Robot mode

Remember whether a machine is waiting, moving, or correcting.

Program connections

Where this topic appears.

Active now

Scratch & Game Design

Beginner-friendly programming through original games, animations, simulations, and interactive stories.

Active now

Robotics

Commands, sensors, simple electronics, simulations, and physical systems organized around Sense, Decide, Act.

Available later

Roblox Studio / Lua

A future bridge from visual programming to Lua, 3D objects, events, and larger game systems.

Available later

AI & Smart Machines

A future practical and critical program about patterns, predictions, prompts, limits, and human judgment.

Common mistakes

Useful clues, not reasons to stop.

Never resetting

A new game begins with values from the previous run.

Changing in two places

A score jumps unexpectedly because several scripts update it.

Vague names

Variables called thing or number hide their purpose.

Confusing value and display

Hiding a variable monitor does not reset its stored value.

Lesson and projects

Use the idea inside a working system.

Open Lesson