📍
Coding🚀 Ages 7-10Beginner 9 min read

Coordinates and Movement in Scratch

A clear primary lesson on coordinates and movement in Scratch: understand the x and y grid, move sprites with go to and glide, and draw shapes. With a hands-on quiz.

Key takeaways

  • The Scratch stage is a grid with an x position (left-right) and a y position (up-down)
  • The center is x: 0, y: 0; x grows to the right, y grows upward
  • 'go to x y' jumps a sprite instantly; 'glide' moves it smoothly over time
  • 'change x' and 'change y' move a sprite by a small step from where it is now

The stage is a grid

Every sprite in Scratch lives on the stage, the big area where your characters move. The stage is secretly a grid, like graph paper.

To say exactly where a sprite is, Scratch uses two numbers:

  • x is the left-right position.
  • y is the up-down position.

We write a position like this: x: 100, y: 50. That means "100 to the right and 50 up from the center."

If you are brand new to Scratch, peek at getting started with Scratch first to learn about sprites and blocks, then come back.

The center is zero

The most important spot on the stage is the center. The center is x: 0, y: 0.

From the center, the numbers spread out:

  • Move right and x gets bigger: 0, 50, 100, 150...
  • Move left and x gets smaller, going negative: 0, -50, -100, -150...
  • Move up and y gets bigger: 0, 50, 100, 150...
  • Move down and y gets smaller, going negative: 0, -50, -100, -150...

The whole stage is 480 wide and 360 tall. So x goes from about -240 (far left) to 240 (far right), and y goes from about -180 (bottom) to 180 (top). Here is a simple map of the four corners:

(-240, 180) ........ (240, 180)
     .       (0,0)        .
(-240,-180) ........ (240,-180)

Tip: in Scratch, when you move your mouse over the stage, the current x and y show in the bottom-right corner. Try it to see the numbers change!

Jump there with 'go to x y'

The simplest movement block is go to. It places the sprite at an exact spot, instantly:

when green flag clicked
go to x: 0 y: 0

This snaps the sprite right to the center. Change the numbers to send it anywhere:

go to x: 100 y: -50

That puts the sprite 100 to the right and 50 down. The move happens in a blink — no smooth motion, just a jump.

Move smoothly with 'glide'

What if you want the sprite to slide across the stage instead of jumping? Use the glide block:

when green flag clicked
go to x: -200 y: 0
glide 2 seconds to x: 200 y: 0

This makes the sprite start on the left and smoothly glide to the right over 2 seconds. Glide is great for things like a fish swimming or a car driving across the screen. A bigger number of seconds makes the glide slower; a smaller number makes it faster.

Take small steps with 'change'

Sometimes you do not want to go to an exact spot. You want to nudge the sprite a little from where it already is. That is what change x and change y do:

change x by 10

This means "add 10 to my current x," which moves the sprite 10 to the right. If the sprite was at x: 50, it is now at x: 60. Use a negative number to go the other way:

change x by -10

This moves the sprite 10 to the left. The same works for y:

  • change y by 10 moves the sprite up 10.
  • change y by -10 moves the sprite down 10.

These blocks are perfect inside a forever loop for arrow-key control, which is exactly how the player moves in a game. See making a game in Scratch to put this to work, and loops and repeats to understand the forever loop.

Drawing with coordinates

Coordinates let you draw shapes too! With the Pen blocks, you can lower a pen and move the sprite to draw lines. Here is a square:

when green flag clicked
go to x: -50 y: -50
pen down
go to x: 50 y: -50
go to x: 50 y: 50
go to x: -50 y: 50
go to x: -50 y: -50
pen up

Each go to draws a line to the next corner. Together they make a square with sides 100 long. Change the numbers and watch the shape change!

Try it: the coordinate treasure hunt

Here is a challenge to test your new skills.

  1. Place a "Star" sprite somewhere on the stage by dragging it. Hover your mouse over it and read its x and y.
  2. Now click the cat sprite and write a script that sends the cat to the star using go to x: ___ y: ___ with the numbers you read.
  3. Click the green flag. Did the cat land right on the star?
  4. Bonus: instead of go to, use glide 1 seconds to x: ___ y: ___ so the cat slides to the treasure smoothly.

When you can move a sprite to any spot you choose, you have unlocked one of the most useful skills in Scratch. Everything from games to animations is built on coordinates! 📍

Quick quiz

Test yourself and earn XP

Where is the point x: 0, y: 0 on the Scratch stage?

To move a sprite to the RIGHT, you make x...

What does 'change y by 10' do?

What is the difference between 'go to' and 'glide'?

If a sprite is at x: 50 and you 'change x by -20', where is it now?

FAQ

x is the left-right position of a sprite and y is the up-down position. Together they say exactly where a sprite is on the stage.

The stage is 480 wide and 360 tall. x runs from about -240 on the left to 240 on the right, and y runs from about -180 at the bottom to 180 at the top.