arrow_back Adding Motion (challenge)
In this add-on, you will add motion to your story using “glide” blocks.
Take a look at the motion menu. It contains many blocks that can move a sprite.
This video will introduce the “glide” block, but there are many ways to program a sprite to move.
To start, drag out a “glide” block. Click to test it. Notice that the sprite doesn’t glide anywhere. To make the sprite move, you need to enter an x and y position for the sprite to to glide to. Every position on the stage has an x and y value. To see those values, point your mouse to a position on the stage, and read the values output below it. In this example, the sprite will glide to the other side of the stage. That’s about x = 200 and y = 30. Try this in your project.
Then, try it to see how it works!
Once the sprite glides to the correct position, add the “glide” block to your story.
Press the green flag to try it out. Oh no! The sprite started in the position it was supposed to glide to. To fix this, set a starting position for your sprite using a “go to” block. The “go to” block works like the glide block, but it makes the sprite simply appear in a specific position, instead of gliding there.
To easily enter values in the “go to” and “glide” blocks, drag the sprite to the right position. Notice that the values in the block change based on the location of the sprite. Then, just place the block at the start of your program.
Try it out now! Great! The sprite starts at one position and glides to another.
for the sprite to glide to, and enter those values in the block.
Once you’ve added one “glide” block, try adding some more. See what type of motion you can create in your story!