getting started with scratch
Motion
Glide to an Object and Back
Tip: When you drag a sprite on the Stage, the motion blocks that use x
and y
coordinates update in the Motion
blocks menu. The current x
and y
coordinates are show in the Sprite pane.
Rotation
You can also change the direction
that a sprite is pointing in. This changes the direction that the sprite will move in if you use a move
block. It may also change the rotation of the sprite’s costume depending on the rotation-style
setting.
When you add a sprite, it will be facing right (90 degrees). You can change this in the Sprite pane or using code blocks.
Sprite Direction
The direction of a sprite controls how much it is rotated.
When you add a new sprite it points to the right which is a direction of 90 degrees.
Direction | Degrees |
---|---|
Up | 0 |
Right | 90 |
Down | 180 |
Left | -90 |
You can change the direction of a sprite in the Sprite pane. Click on the direction number and move the arrow that appears, or type a number.
You can also use the point in direction
block:
The sprite’s direction is used by the move
block. Changing the direction of a sprite may also change the rotation of the sprite’s costume depending on the sprite’s rotation-style
.
Stop a sprite going upside down
When you add a sprite, its rotation-style
is set to all around
. If you make the sprite point left (-90 degrees) then the sprite costume will go upside down when the sprite rotates!
Sometimes this is what you want, but if you have a sprite that moves left and right then you often want the sprite to point left or right depending on the direction it is facing.
Click on the Left/Right icon in the middle to change the rotation style to left-right
to stop a sprite turning upside down:
There’s also a code block that you can use:
Spin around
Spinning bat: See inside
This code makes a sprite spin when the green flag is clicked:
In a turn
block within a forever
loop, change the number of degrees to 1
and your sprite will appear to spin.
Tip: If you do not add a move
block, your sprite will spin in the position that it is in.
Move in a circle
Moon orbit: See inside
This code makes a sprite fly in a circle when the green flag is clicked:
Bouncing
Bounce across the Stage
Girl moving across the Stage: See inside
This code makes a sprite bounce on the left-hand and right-hand edges of the Stage. Because the sprite rotates horizontally, it appears to flip when it changes its direction when the green flag is clicked:
Bounce up and down the Stage
Girl jumping: See inside
This code makes a sprite bounce up and down the Stage when the green flag is clicked:
Bounce at an angle
Football bouncing: See inside
This code makes a sprite appear to rotate randomly when the green flag is clicked:
Using coordinates
You can also change
and set
the x
and y
coordinates and get their values to use in other blocks:
Scratch coordinates
I can’t see any Motion blocks
If you have the Stage selected then you won’t see any Motion
blocks, because the Stage can’t move.
Click on a sprite in the Sprite pane and then click on the Code tab to see the Motion
blocks.