Free learning tools for curious minds, families & classrooms
the curiosi
AI Quiz Maker

LEARN · PRACTISE · DISCOVER

Moving Sprites with Motion and Coordinates

Read at your own pace. Try the practice, then continue your course.

Moving sprites around the stage is the heart of most games and animations. Scratch gives you two ways to move: moving by steps and turns, and moving to an exact spot using coordinates. In this lesson you will learn both.

Steps and turns

Directions in Scratch

DirectionSprite faces
90right
-90left
0up
180down

The stage is a grid

The stage is like a big map with an invisible grid. Every spot on the stage has two numbers called coordinates.

When you move a sprite with your mouse, look under the stage: its x and y numbers change.

Coordinate blocks

BlockWhat it does
go to x: (0) y: (0)jumps straight to a spot
glide (1) secs to x: (100) y: (50)slides smoothly to a spot
change x by (10)moves right (use a negative number to move left)
change y by (10)moves up (use a negative number to move down)
go to (random position)jumps to a surprise spot

Making a sprite glide around

This script makes a sprite start in the centre and glide to three corners:

when green flag clicked
go to x: (0) y: (0)
glide (1) secs to x: (-200) y: (140)
glide (1) secs to x: (200) y: (140)
glide (1) secs to x: (200) y: (-140)

Starting positions

Always set a sprite’s starting spot with go to x: () y: () at the top of your script. Then the project starts the same way every time you click the green flag.

Example

Priya made a rocket launch. Her rocket started at x: 0, y: -150 near the bottom. Then she used glide (2) secs to x: (0) y: (170) to fly it up to the top. When she clicked the green flag, the rocket blasted off!

Bouncing off the edge

If a sprite keeps moving, it may disappear off the side. Add if on edge, bounce after your move block, and the sprite will turn around when it touches the edge. You will use this with loops in Lesson 5.

Key takeaways

Practice

Make a bird sprite start at the left side of the stage, at x: -200, y: 0, then glide to the right side in 3 seconds, then say “I made it!”.

Answer: when green flag clicked, go to x: (-200) y: (0), glide (3) secs to x: (200) y: (0), say (I made it!) for (2) seconds.

Share this
error: Content is protected !!