Please update your browser
Your browser version is not supported by this site. CS First may not work properly.
In this add-on,
you will draw and program clouds in the sky
to make it look like the boat is moving.
To start, draw the clouds.
Click paint new sprite.
To make clouds,
draw a series of overlapping circles.
Select the ellipse tool,
the fill option,
and your preferred cloud color.
Then draw overlapping circles
until you have a cloud-like shape.
If you make a mistake,
click the undo button,
then keep drawing.
Once you have one cloud,
group all of the ellipses into one shape.
Click the select tool,
then click and drag to select the entire cloud.
Then click the group tool.
Next, copy the cloud.
The paint editor window is the exact size of the stage.
So to get the clouds to start and end off the stage,
drag each shape so about half of the cloud
is off each edge of the paint editor.
Now that you have a cloud sprite,
program it to move.
Click the motion menu.
Set the sprite's starting position
so that it's off the right side of the stage.
Drag out a go to block.
The right edge of the stage
has a x value of 240.
To get this sprite to start off the edge of the stage,
set the x value of this block to something large, like 500.
You might even want to tinker with this value again
once you've got a working program to see what works best.
Next, program the sprite to glide
off the left side of the stage.
Drag out a glide block.
The left edge of the stage has a value of negative 240.
Set the x value of this block to a large negative number
like negative 500.
Click the stack to try it out.
Great, the clouds flew by.
Before tinkering with the cloud's speed,
program them to repeat moving.
Click control and add a forever loop.
Click the stack to test.
Now that you have a loop,
tinker with these values while the code is running
to get a movement that you like.
The time value in the glide block adjusts the speed,
and the x values change the sprite's starting
and ending positions.
To make the clouds appear behind the boat,
program the cloud sprite to go to the back of the stage.
Click looks and add a go back layers block.
Change the value to 10.
Finally, add a when flag clicked block
to run this code at the start of your program.
Click the flag to test.
Now it's your turn.
Click paint new sprite,
draw two clouds using the ellipse,
group, and duplicate tools.
Start the cloud beyond the right edge of the stage
with a go to block that contains a large x value.
Glide the cloud past the left side of the stage
with a glide block that has a large negative x value.
And finally, complete the animation with forever,
go back layers,
and when flag clicked blocks.