top of page
Search
Writer's pictureRahul Kumar Nag

Learn How To Move Your Sprites



In scratch, if you want to animate a character or move it along an axis, you must know the motion palette to move sprites. In this blog, you will learn how to move the sprites using motion commands.


The motion commands can be classified into two types:

  • Absolute Motion

  • Relative Motion

Absolute Motion:

Scratch has four absolute commands;

  • Go to

The go to () block is a motion block and a stack block. The block sets its sprite’s X and Y positions to the specified position, which can be that of another sprite, the mouse pointer, or random coordinates.




  • Set x and set y command

This command is used for independently changing the x position and y position of a sprite.

  • The Glide commands

The block moves its sprite at a steady pace to the specified sprite or the mouse-pointer from a drop-down. A downside to the block is that, while gliding, it pauses the script so that nothing else can happen during this time.


Relative Motion:


The relative motion moves the sprite to a position defined by the number of steps it takes from its current position. Of course, you also need to specify the direction in which the sprite should move

(right, up, etc.).

  • Move Command

The move() Steps block is a Stack block and a Motion block. Unlike Change X by() or Change Y by(), this block moves forward the specified number of "steps" in the direction the sprite is pointing.




  • Change X and change Y

This block uses it to change the sprite's X/Y position by the specified number. The X axis ranges from -240 to 240 and the Y ranges from -180 to 180, but the sprite can move further.

  • Turn command

The blocks change their sprite's direction by the specified amount of degrees in the direction indicated. The blocks support any input value from -179 to 180.








6 views0 comments

コメント


bottom of page