A sprite blurring with movement.

Movement is used to show action. It is easy to make different types of movement on scratch. Projects with movement commonly use the Change X by (), Change Y by (), and Move () Steps blocks. They are used in almost every Scratch project.

Following the Mouse

It is easy to script an object following the mouse. It is commonly used for top down games. It looks best to set the rotation style to "Full rotation".

 when gf clicked // Starts the script.
forever // Makes it so the movement will keep going.
point towards [mouse-pointer v] // Aims for the mouse.
move (10) steps // Moves.

Top-Down Arrow Keys Movement

This engine gives the player more control over where they move. It is an alternative to the mouse following engine. But this engine allows a player to only move horizontally and vertically.

when green flag clicked // Starts the script.
forever // Lets the script repeat.
if <key [Up arrow v] pressed?> then // If key is pressed.
repeat until <not <key [Up arrow v] pressed?>> // Repeats until key is not pressed.
change y by (10) // Moves in wanted direction.

end
end
if <key [Down arrow v] pressed?> then // Same here.
repeat until <not <key [Down arrow v] pressed?>>
change y by (-10)
end
end
if <key [Right arrow v] pressed?> then // Same here too.
repeat until <not <key [Right arrow v] pressed?>>
change x by (10)
end
end
if <key [Left arrow v] pressed?> then // Also the same here.
repeat until <not <key [Left arrow v] pressed?>>
change x by (-10)

If you want something even simpler, try this. This engine also allows not just to move horizontally and vertically, but diagonally. It works since the forever loop detects all keys and is not stopping on a single script.

when green flag clicked // Starts the script.
forever // Lets the script repeat.
if <key [Up arrow v] pressed?> then // If key is pressed.
change y by (10) // Moves in wanted direction.
end
if <key [Down arrow v] pressed?> then // Same here.
change y by (-10)
end
if <key [Right arrow v] pressed?> then // Same here too.
change x by (10)
end
if <key [Left arrow v] pressed?> then // Also the same here.
change x by (-10)
end
end

This works since only when the movement key is pressed, the sprite will move. This can save you time.

Velocity Movement

A more detailed version of the others. This works from a sideways platformer perspective.

when gf clicked // Starts the script.
forever // Allows movement to be repeated.
if <key [right arrow v] pressed> then // Detects an input.
change [X Velocity v] by (1) // Moves in the wanted direction.
end // (Same goes for left movement.)
if <key [left arrow v] pressed> then
change [X Velocity v] by (-1)
end //
set [X Velocity v] to ((X Velocity) * (0.9)) // Slowly slows down speed.
change x by (X Velocity) // Makes the sprite move.

See Also