Topic Guide

Events and Commands

An event tells a program when to respond. Commands say what to do, and their order matters.

Why this matters

The green flag, a key press, and a robot's button are all triggers. Students connect each trigger to a short sequence, then change the order and watch the result change.

Beyond this topic

Press an elevator button and a sequence begins: record the request, move the car, stop at the right floor, and open the door. Games and robots arrange their responses the same way.

Math and logic

Trigger

The event that starts a script.

Sequence

The order in which commands run.

Cause and effect

A key is pressed, so the sprite jumps.

Specific commands

The program needs an action it can actually carry out.

Small examples

1

Green flag

Put a Scratch scene into its starting state.

2

Key press

Run an action when the player chooses a key.

3

Button input

Connect a physical press to a light or sound.

4

Message received

Begin one script when another has finished its job.

Program connections

Where this topic appears.

Active now

Scratch & Game Design

Students author games, animations, simulations, and strange interactive stories while learning how events, rules, and state fit together.

Active now

Robotics

Students write commands, wire simple circuits, read sensors, and trace physical cause and effect through the Sense–Decide–Act loop.

Coming later

Roblox Studio / Lua

A possible later step from visual programming into Lua, 3D objects, events, and larger game rules.

Common mistakes

Wrong order

The character moves before its position has been reset.

Missing trigger

The blocks are correct, but nothing starts them.

One event doing everything

A long script makes it hard to find which response failed.

Timing assumed

The next command runs before a movement or animation has finished.

Put the idea to work

Read the Lesson
Robotics Guided Project

Button and Buzzer Alarm

Connect a button to a visible and audible alarm, then write clear rules for arming, triggering, and resetting it.

  • Input
  • Output
  • Events
  • Conditions
See how it works
Scratch & Game Design Guided Project

Quiz of Questionable Knowledge

Build a quiz that checks answers, gives useful feedback, keeps score, and knows which question comes next.

  • Conditions
  • Variables
  • Input
  • Messages
See how it works