This video will show you how to make an object fall from the sky so that the characters cancatch it.
First, make the object fall.
Click on the blue star.
From the motion menu, use the “change y by” block.
When you click on this block, notice that the blue star goes up on the screen.
To make the object fall, change the value in the “change y by” blockto a negative number.
Test it out.
The object goes down each time you click the block.
Tinker with the value to determine how fast or slow the object falls.
To make the object keep moving down, drag out a forever loop from the control menu,and put it around the “change y by” block.
Next, code the blue star to return to the top of the screen.
From the motion menu, drag out a “go to x y” blockto set the object’s starting position.
Type in “170” in the “y” portion of the block.
170 is near the top of the screen. Click on it to test.
The object should move to the top of the screen.
Snap the “go to x y” block above the “forever” loop.”
Click on the code. The sprite starts at the top of the screen and falls all the way down.
To make this game more fun, the object needs to fall from different spots so that the charactersmust move to catch them. To make the object fall from an unpredictable spot, go to the“operators” menu, and place a “pick random” block in the x value of the “goto x y” block. The left and right edges of the screen range from -240 to 240, so enterthose values into the “pick random” block. Click on the code to test it. The object startsat the top of the screen and falls down. Click the stop sign, then click on the code again.
The object starts in a different spot and falls. Great!
Now it’s your turn: Program the object to fall by putting a negativenumber in the “change y by” block and using a “forever” block.
Program the object to start at the top of the screen using the “goto x y” blockProgram the object to start at a random location using a “pick random” block.