Lesson / Scratch & Game Design

What Makes a Program Start?

The robot hamster has five perfectly good commands and no idea when to begin. Give it a trigger, arrange the commands, and see how one change in order alters the route.

Lesson plan

  1. A route with no start

    Run the command list without an event and identify what is missing.

  2. Triggers and order

    Connect short command sequences to the flag, a key, and a message.

  3. Build the hamster route

    Set a known start, add controls, and run an ordered patrol.

  4. Move one command

    Change the order, predict the new route, and check the result.

  5. Show the cause

    Demonstrate which event starts the route and which command changed it.

Learning goals

  • Match an event with its response.
  • Put commands in a deliberate order.
  • Predict a short sequence before running it.
  • Keep setup separate from repeated actions.
  • Explain one cause-and-effect link in the program.

Small examples

when green flag clicked

set the starting state

when space key pressed

respond to one chosen input

broadcast START

tell another script to begin

move / turn / wait

make an ordered route

Guided project

Robot Hamster Command Centre

Program a robot hamster to patrol snack storage without treating every crumb as an international emergency.

Build This Project
Students build

A grid-like map, Clear movement commands, A known start, A target route.

Ideas in use

Events, Commands, Sequences, Coordinates, Messages.

Finish line

A working version with a tested change, one repaired problem, and a clear explanation.

Teacher checkpoints

  1. 1The student can point to the trigger.
  2. 2A three-command sequence is predicted before it runs.
  3. 3Restarting produces the same setup.
  4. 4Each event has a clear job.
  5. 5The student changes the order and explains the result.

Common mistakes

  • The commands are present, but no event starts them.
  • The hamster moves before its position is reset.
  • Two scripts try to control the same action.
  • Timing is changed before the command order is checked.

Optional challenges

LEVEL 1

Builder

  • Add a second command key.
LEVEL 2

Inventor

  • Broadcast a mission-complete event.
LEVEL 3

Boss Level

  • Build a queue of commands before execution.

End-of-class demonstration

  1. What event starts the program?
  2. Which command runs first?
  3. What changed when the order changed?
  4. Which part is setup?
  5. What did you debug?