Please update your browser
Your browser version is not supported by this site. CS First may not work properly.
In this video, you'll learn
how to make sprites move around on the stage.
In Scratch, the stage is a coordinate plane.
You may have learned about coordinate planes before
in math class.
The horizontal part of the stage is called the x-axis
and it is number from negative 240 to positive 240.
The vertical part of the stage is called the y-axis
and it is numbered from negative 180 to positive 180.
The numbers along the x and y-axis of the stage
are called coordinates.
Every position on the stage has a pair of coordinates
that represent where the x and y-axis intersect
at that point.
In the example project, the my sprite moves
to stand next to the best friend sprite.
Your sprites don't need to move like the ones
in the example project, it's just an example.
Your sprite should move however makes sense in your story.
In Scratch there are lots of ways to make sprites move.
You could use the move 10 steps block,
the go to x y block,
the glide one second to x and y block,
or the change x by 10 and change y by 10 blocks.
In computer science there are often many ways
to solve the same problem.
You can choose whichever way works best
for you and your story.
This example uses the glide block,
but you can use any motion blocks that work
for your project.
To find out the x and y coordinates that the my sprite
should go to, drag the my sprite to the spot where you
want it to end.
The x and y values will update in the glide block, perfect.
Drag out the glide block and connect it
to the block stack for the sprite.
Click the green flag to test your code.
Wait, that's not right.
The sprite starts at the new location you just set
rather than returning to it's original position.
That's because you have to program it to go back
to the starting point using a goto block.
Click and drag the sprite to the location where you
want it to be, to get the correct coordinates.
Add the goto block to the beginning of the block stack,
then test the code again.
Great, it works.
Use wait blocks to make the program work in sequence.
To continue building your story add another sprite
and program it to move however you like.
Use wait, hide and show blocks to make the new sprite
appear and move on the stage at the right time.
Now it's your turn.
Use motion blocks to make a character in your story move,
if you'd like add another sprite and use motion blocks
and wait, hide and show blocks to make it appear
and move on the stage.