Lesson / Scratch & Game Design

How Does the Screen Know Where You Are?

A giant pigeon is chasing your character across Calgary. Give both sprites reliable positions, move the player with x and y, and decide exactly what counts as being caught.

Lesson plan

  1. The chase

    Work out how the stage records the player and pigeon positions.

  2. Coordinates

    Read x and y, predict changes, and return to the origin.

  3. Build the game

    Add movement, pursuit, collision, and a safe zone.

  4. Change a rule

    Choose one modification, predict the result, and try it.

  5. Show and explain

    Run the game and use coordinates to explain one part.

Learning goals

  • Read x and y positions.
  • Move a sprite horizontally and vertically.
  • Set a known starting position.
  • Predict the result of coordinate changes.
  • Recognize screen boundaries.
  • Use position information while debugging.
  • Explain movement using numbers.

Small examples

change x by 20

move right

change x by -20

move left

change y by 20

move up

change y by -20

move down

go to x: 0 y: 0

return to the centre

Scratch direction and Scratch position are related, but they are different. Direction describes where a sprite faces; position describes where it is.

Guided project

Escape from the Giant Pigeon

Reach the shelter before a huge pigeon catches you. Under the absurd premise is a precise system of coordinates, collision checks, and two possible endings.

Build This Project
Students build

Keyboard movement in four directions, Known starting positions, A pursuing pigeon, One or more safe areas.

Ideas in use

Scratch, Coordinates, Movement, Collision, Game State.

Finish line

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

Teacher checkpoints

  1. 1The student can identify the origin.
  2. 2Four coordinate changes are predicted before they run.
  3. 3Restarting returns the player to the chosen position.
  4. 4The student explains one movement bug using x or y.
  5. 5At least one rule has been changed independently.

Common mistakes

  • Changing x when the intended movement is vertical.
  • Using the wrong positive or negative sign.
  • Testing from an unknown starting position.
  • Confusing the direction a sprite faces with its position.

Optional challenges

LEVEL 1

Builder

  • Add screen wrapping.
  • Add a second safe zone.
LEVEL 2

Inventor

  • Create a temporary turbo move.
  • Add a boundary warning.
LEVEL 3

Boss Level

  • Optionally make pigeon speed depend on approximate distance.

End-of-class demonstration

  1. What did you build?
  2. Which number controls left and right?
  3. Which number controls up and down?
  4. What went wrong?
  5. What did you change?