First Step: Step! Motion
Quick References for all Motion blocks
Move (number) steps: This block moves the sprite forward by a specified number of steps.
Turn (number) degrees (clockwise): This block rotates the sprite clockwise by the specified number of degrees.
Turn (number) degrees (counterclockwise): This block rotates the sprite counterclockwise by the specified number of degrees.
Go to (random position): This block moves the sprite to a random position on the stage.
Go to x: (number) y: (number): This block moves the sprite to the specified x and y coordinates on the stage.
Glide (number) secs to (random position): This block moves the sprite smoothly to a random position over a specified number of seconds.
Glide (number) secs to x: (number) y: (number): This block moves the sprite smoothly to the specified x and y coordinates over a specified number of seconds.
Point in direction (number): This block points the sprite in the specified direction, where 0 is up, 90 is right, 180 is down, and -90 is left.
Point towards (mouse-pointer or sprite): This block points the sprite in the direction of the mouse-pointer or another sprite.
Change x by (number): This block changes the sprite's x-coordinate by the specified number, moving it horizontally.
Set x to (number): This block sets the sprite's x-coordinate to the specified number.
Change y by (number): This block changes the sprite's y-coordinate by the specified number, moving it vertically.
Set y to (number): This block sets the sprite's y-coordinate to the specified number.
If on edge, bounce: This block makes the sprite bounce back if it touches the edge of the stage.
Set rotation style [left-right, don't rotate, all around]: This block sets the sprite's rotation style to one of three options:
left-right: The sprite flips left and right.
don't rotate: The sprite doesn't rotate.
all around: The sprite rotates freely in all directions.
X position: This block reports the sprite's x-coordinate.
Y position: This block reports the sprite's y-coordinate.
Direction: This block reports the direction the sprite is pointing in.
move(number)steps
Make the sprite(character) move a certain number of steps in the direction it is facing.
Example:
move(10)steps -> forward 10 steps
move(-10)steps -> backward 10 steps
Click the green flag to move forward 10 steps
Click the cat to move backward 10 steps
turn(number)degrees
Make the sprite(character) rotate certain degrees clockwise(right) or counterclockwise(left).
Example:
turn↩️(90)degrees -> turn 90 degrees clockwise
turn↩️(-45)degrees -> turn -45 degrees clockwise = turn 45 degrees counterclockwise
turn↪️(90)degrees -> turn 90 degrees counterclockwise
Click the green flag to start
Press -> key to turn clockwise 90 degree
Press <- key to turn counterclockwise 15 degree
Click the red flag to stop
XY- Coordinates and Position in Scratch
In Scratch, the position is represented with x and y like two number lines or rulers📏. The center of the stage is (0,0).
X is for ⬅️left and right➡️. The number goes bigger when things go to the ➡️right and smaller to negative when they go to the left⬅️.
Y is for ⬆️up and down⬇️. The number goes bigger when things go up⬆️and smaller to negative when they go down⬇️.
Tips: xy coordinate is the same as in math where x increases from left to right, and y increases from down to up. The sprite's coordinates are usually decided by the center of the sprite but can be modified in costume. The grey cross (shown on the left) is the point where the sprite position is calculated. It overlaps with the blue cross( center of the sprite) by default, so you need to move the sprite to see it.
XY Position visualizer
Click the green flag to start:
Click the cat to make it move to a random position.
Click the background to change the backdrop.
go to (position)
go to x:(number) y:(number)
Make the sprite appear in a certain position immediately. Can be a position available in the drop-down menu or described by xy coordinate.
Example:
go to (random position)
go to x:118 y:90
Click the green flag to start: the apple will go to the starting position.
Click the apple to make it go to a random position.
glide(number)second to (position)
glide(number)second to x:(number) y:(number)
Make the sprite go to a certain position in certain seconds. Can be a position available in the drop-down menu or described by xy coordinate.
Example:
glide 1 secs to (random position)
glide 1 secs to x:-175 y:0
Click the green flag to start: the cat will take 1 second to glide to the starting position.
Click the cat to make it glide to a random position in 1 second.
point in direction(number)
point toward(object)
Make the sprite face a certain direction. Point in direction takes in a degree, while point toward will make it point to the direction of an object chosen from the drop-down menu.
Corresponding direction degree numbers are shown as the last picture in the middle.
Example:
point in direction (90)
point toward(mouse-pointer)
Click the green flag to start:
Click the pink arrows to make the cat face a certain direction.
Click the purple arrow to make it always face the mouse direction.
change x/y by(number)
set x/y to(number)
Make the sprite move to a certain position. Change x/y takes the number of steps to move in the corresponding direction, while set to will make it go to a certain position of that specific x/y value.
Example:
change x by (10) -> move right 10 steps
set y to (0) -> move to the point with same x but y is 0 (middle line vertically)
Click the green flag to start:
Use WASD keys to control the cat's position.
Press the space key to make it always go to the center (0, 0).
if on edge, bounce
x/y positon, direction
[if on edge, bounce] block keeps sprite on the screen.
x/y position and direction bubbles store the current value of x, y, and the direction of a sprite. You can use these bubbles in any oval shape blank as a number. You can also check the box next to them to show these values on the screen.
Example:
say (x position) for (1) seconds
say (direction) for (1) seconds
Click the green flag to start:
Use WASD keys and <- -> keys to move the cat to the edge of the screen.
Press the space key to make it say the current position and direction.