Coordinates
๐จ๐ฑ Technique Card: Understanding Coordinates in Scratch
How to use coordinates in Scratch!
โจ What Are Coordinates?
Scratch uses a 2D grid system to position sprites on the stage. Each place on the stage has an (x, y) coordinate:
Axis | Direction | Values go from | Example |
---|---|---|---|
x | Left โ Right | -240 to 240 | x = -100 is left of centre |
y | Down โ Up | -180 to 180 | y = 150 is near the top |
The centre of the stage is at (0, 0) โ right in the middle.
๐งช Try It!
Click on a sprite, then:
- Use the
go to x: ___ y: ___
block (from Motion category) - Try different values and watch the sprite jump to those spots
- Try
glide 1 secs to x: ___ y: ___
for smooth movement
๐ Top Tips
- Use positive x values to move right, negative x to move left
- Use positive y to move up, negative y to move down
- Use the Xy-grid backdrop (in the Backdrops library) to help visualise the coordinate system
๐ก Handy Blocks
go to x: 0 y: 0
โ sends sprite to centreglide 1 secs to x: 100 y: -100
โ smooth glideset x to 150
/set y to -80
โ move only in one direction
๐ ๏ธ Challenges
- Make a sprite jump to the corners of the stage using
go to x: y:
blocks - Make a sprite glide in a square using
glide
and different coordinates - Combine with
when green flag clicked
to set starting position