Please update your browser
Your browser version is not supported by this site. CS First may not work properly. Learn more.
This video will show you how to make an object
fall from the sky so the characters can catch 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 block
to 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 how 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 XY block
to set the object 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 XY 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 characters must 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 Go to XY block.
The left and right edges of the screen
range from -240 to +240.
So enter those values into the Pick Random block.
Click on the code to test it.
The objects starts at the top of the screen and falls down.
Click the stop sign,
then click on the code again.
The objects starts in a different spot and falls.
Sign in to track your progress and earn badges