Scratch: Coordinates and Broadcast in an Animation

In Maths, you plot points like (2, 3) on a grid. Did you know the Scratch stage is a grid too? Every sprite has an x and a y, and once you know them, you can send a sprite to any spot you like. Add messages that let sprites talk to each other, and you can make a two-player game.

A coordinate grid with x and y axes crossing at the origin (0,0), with the points (2,3), (−3,1) and (−1.5,−2.5) plotted in different colours.
A coordinate grid from Maths. The point (2, 3) is 2 to the right of the centre and 3 up. The Scratch stage works the same way.

Image source: File:Cartesian-coordinate-system.svg (Wikimedia Commons)

In this post:

  • Coordinates on the Scratch stage, and directions
  • Forever loops that run for the whole game
  • Broadcast and receive: how sprites send each other messages
  • Exploring a two-player catch game and a broadcast animation
  • A coordinate challenge, an ordering activity, a game plan and a quiz

The Scratch stage is a grid

The stage is 480 steps wide and 360 steps tall. The centre is (0, 0).

Place on the stagexy
Centre00
Right edge240–
Left edge−240–
Top edge–180
Bottom edge–−180
Top-right corner240180
Bottom-left corner−240−180
  • x tells you how far left or right: bigger x means further right; negative x is left of centre.
  • y tells you how far up or down: bigger y means higher; negative y is below the centre.
  • Click a sprite and look under the stage: Scratch shows its x and y. In the Motion blocks, go to x: y: and glide already contain the sprite’s current position.

Directions: point in direction uses angles: 90 = right, −90 = left, 0 = up and 180 = down. move 10 steps then moves the sprite the way it is pointing.

Activity: catch the star

Try it: use coordinates to reach the star

Move your mouse over the stage to see its x and y, just like in Scratch. Find the star’s coordinates, type them into the block and click Run the block. Try glide too!

-200-100100200-150-100100150

Mouse: x: – y: –

x: y:

Forever loops

A forever loop repeats the blocks inside it until the red stop sign is clicked. Games use forever loops for things that must keep happening all game long: checking the keys, moving enemies, checking whether something was caught. A forever loop with no condition inside simply keeps doing its job, for example forever: move 10 steps, if on edge, bounce.

Broadcast and receive

Sprites cannot see each other’s scripts. To work together, they send messages:

  • broadcast [StartGame] sends a message to every sprite and the stage.
  • when I receive [StartGame] is a hat block. The script under it runs when that message arrives.
  • broadcast [message] and wait waits until all the receiving scripts have finished before going on.

This is how you coordinate sprites, so they act at the right time, like actors who come on stage when they hear their cue.

Explore: Catch the Apples

This two-player game was made for a Form 3 class. Click the green flag, then press space to start. The cat moves with the left and right arrow keys and the dog moves with A and D. Catch as many falling apples as you can!

Scratch project: (C59) Catch the Apples by kunge.

Here is how the sprites work together:

SpriteWhat its scripts do
Apple (when the green flag is clicked)Sets Cat’s Score and Dog’s Score to 0, says “Catch the falling apples, press space to start.” and then uses a forever loop to check for the space key. When space is pressed, it broadcasts StartGame.
Cat and DogEach has a forever loop that checks its keys and changes x by 10 or −10. When they receive StartGame, the cat says “Lets Go! Meow” and the dog says “Arf! Apples!”.
Apple (when it receives StartGame)Hides itself, then, forever, makes a clone (a copy) of itself every 0.6 seconds.
Each apple cloneAppears at a random x with y = 120 (near the top), then keeps changing y by −10 until it touches the edge, the dog or the cat. If it touched the cat, Cat’s Score goes up by 1; if it touched the dog, Dog’s Score goes up by 1. Then the clone deletes itself.

Notice the coordinates: go to x: (pick random −180 to 180) y: 120 drops each apple at a different place across the top, and change y by −10 makes it fall.

Explore: a broadcast animation

In this short animation, the green flag script sends one message, Start animation. Two scripts receive it and run at the same time: one glides the cat from (−191, −131) to (194, −129) in 2 seconds, while the other switches costumes every 0.1 seconds until the cat’s x is bigger than 193. Together, they make the cat walk across the stage.

Scratch project: Sprite Animation 3 – Walk and glide by kunge.

Watch: broadcast blocks

This video shows how to use broadcast blocks to make sprites hold a conversation, instead of using lots of wait blocks.

Video: Scratch – How To Use Broadcast Blocks – mrGcoding – https://www.youtube.com/watch?v=0ZHalwPO1og

Activity: what happens first?

Try it: put Catch the Apples in order

Put these events in the order they happen, then click Check.

▲ First

  1. The green flag is clicked and both scores are set to 0
  2. The apple says “Catch the falling apples, press space to start.”
  3. A player presses space and the apple broadcasts StartGame
  4. The cat and dog receive StartGame and speak
  5. The apple hides and starts making clones
  6. A clone falls until it touches the cat, the dog or the edge
  7. The right score goes up by 1 and the clone is deleted

▼ Last

Group task: plan a two-player game

In pairs, plan a simple game that two people can play on one keyboard, for example a football passing game or a race to collect coins. Before you build it, write:

  1. The sprites, and which keys control each one.
  2. The starting position (x, y) and direction of every sprite.
  3. Which forever loops you need.
  4. The messages you will broadcast (for example StartGame, Goal, GameOver) and which sprites receive each one.
  5. How the game ends.

Then build it in Scratch and share it with your class.

Self-check quiz

Click the best answer. You get feedback straight away; only your first click counts towards your score.

1. What are the coordinates of the centre of the Scratch stage?

2. A sprite is at x: 200 y: 0. Where is it?

3. Which direction is point in direction 0?

4. What does broadcast [StartGame] do?

5. In Catch the Apples, what makes each apple fall?

6. What is a forever loop useful for in a game?

Related posts on islandclass.org

Next: Scratch: Asking Questions and Using Variables

Syllabus link: Forms 1–3 ICT curriculum, Module 5, Objective 5.14 – develop a simple animated game that coordinates the action of various sprites.

Attributions to media used in this post:

Updates

2026/10/21

– Fixed the activity code so its buttons keep working.

© 2026 Vedesh Kungebeharry. All rights reserved.

Leave a Reply