Learning LabMy course
A
You’re exploring a demo. Progress stays in this tab and resets when you exit the demo.
Back to my course
Mission 02 · Lesson 05

Make something move

Coding & Game Development

35–50 min + optional 15 min

Work at your pace. Take a break between stages; there is no countdown.

You need: paper, a pencil and this lab. A helper is welcome for reading and discussion.

Connect to what you know

Your drawing program followed a sequence. A game must also know WHEN to act.

Understand it, step by step

  1. 1

    An event is something a program can respond to: starting, pressing a key or clicking a button.

  2. 2

    The event handler is the list of actions attached to that event. Our player starts at square 0. A move action adds one to its position.

  3. 3

    A start event happens once. A button event can happen many times. Pressing a button does nothing if no handler is connected to it.

Watch a worked example

Connect “Right button” → “move 1”. One press moves 0 → 1. A second press moves 1 → 2. Connecting “Start” instead moves once when Run is pressed.

Pause and predict

Will three Right presses move the player if the handler listens only for Start?