Lesson / Scratch & Game Design

How Does the Game Know You Touched the Lava?

The floor is convincingly lava-coloured. The computer remains unmoved. Define what counts as danger, check it while the player moves, and make one collision cause one result.

Lesson plan

  1. Define contact

    Decide exactly which sprite or colour counts as safe and dangerous.

  2. Read the sensor

    Compare visible overlap with the value reported by a sensing block.

  3. Build the lava room

    Add movement, jumping, platforms, collision, and game state.

  4. Test the edges

    Try costume boundaries, fast crossings, and contact that lasts several frames.

  5. Show one collision

    Demonstrate the signal, the state change, and a repaired boundary case.

Learning goals

  • Identify the signal used for sensing.
  • Define a collision or boundary.
  • Check a changing signal inside a loop.
  • Prevent one contact from scoring repeatedly.
  • Inspect the sensing result while debugging.

Small examples

touching Lava?

check contact with a sprite

touching colour red?

check a coloured region of the map

distance to hazard < 40

compare distance with a limit

if touching then set state

change the game after contact

Guided project

The Floor Is Definitely Lava

Cross a room whose floor has become lava for reasons the building manager refuses to explain.

Build This Project
Students build

Horizontal movement, A controlled jump, Safe platforms, Lava collision.

Ideas in use

Sensing, Collision, Coordinates, Variables, Game State.

Finish line

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

Teacher checkpoints

  1. 1The student can show the collision area.
  2. 2Sensing continues while the player moves.
  3. 3One contact causes one state change.
  4. 4Restarting clears the collision state.
  5. 5A fast crossing of the boundary has been tested.

Common mistakes

  • Costume transparency makes the hitbox surprising.
  • Contact is checked only at startup.
  • Score rises every frame during one collision.
  • A visual overlap is assumed without reading the sensing result.

Optional challenges

LEVEL 1

Builder

  • Add one safe platform.
LEVEL 2

Inventor

  • Make platforms move while preserving collision.
LEVEL 3

Boss Level

  • Create one-way or temporary safe surfaces.

End-of-class demonstration

  1. What signal counts as contact?
  2. How often is it checked?
  3. What state changes?
  4. How did you test the boundary?
  5. What collision bug did you fix?