Please update your browser
Your browser version is not supported by this site. CS First may not work properly.
In this video, you'll learn how to make a text sprite that will fall across the screen
with a cool effect.
First, use the "paint new sprite" button, and click the "convert to Vector" button.
Use the "text" tool to add a message.
This example will use the company’s name, "Snowman Swag Company," but you can type anything
Drag the sprite to the location on the stage where you want it to begin its fall.
For this effect, the sprite should make multiple copies of itself fall across the screen.
In Scratch, a copy of the sprite is called a "clone."
Once a clone is created in your project, you can add code that tells it what to do.
From the "control" menu, add a "create clone of myself" block
and a "when I start as clone" block.
Each of the clones needs to start at a random place on the screen before falling, so use
a "go to" block with a “pick random” operator.
Input the values negative 240 and positive 240 to represent the right and left edges
of the screen.
This will make each clone start falling from a random spot.
Test it out!
When the "create clone" block is clicked, the code under the "when I start as clone"
A clone appears at a random horizontal location on the screen.
Each clone runs any code under the "create clone" block.
Add “repeat,” “wait,” and "change y by" negative 10 blocks to make each clone
fall down the screen.
Try it out!
Clones fall down the screen, but they pile up on the bottom.
You also need to keep clicking the "create clone" block to make clones.
Add a "delete this clone" block at the bottom of the "when I start as clone" stack to delete
the clones when the code stack finishes running.
Add a "repeat" block, and place the "create clone" block inside it with a "wait" block.
Now, when the “repeat 10” block stack is clicked, multiple clones appear and fall
down the screen.
The only way to run this code, though, is to click on it.
To run it as part of your commercial, add a "when flag clicked" block to the top of
the repeat loop to make the text fall when the flag is clicked.
Or, use “broadcast” and "when I receive" blocks to tell the text exactly when to start
falling down the screen.
In this example, the text doesn't start falling until the end of the commercial.
Now that the basic code for the falling text is set up, you can add fun effect blocks,
like "change ghost effect," "change fisheye effect," and even a "play sound" block with
a short sound.
Tinker with the values in the blocks until you like the speed of the clones, the number
of clones, and the intensity of the effect.
When you tinker with code while it is running, you can easily see how making a small or large
change to one value impacts your program.
Computer scientists frequently tinker with their code.
They don't always know the right answer from the beginning.
They keep trying until their program works the way they want it to.
Keep exploring how making changes affects your program, maybe by using other effect
blocks like “change color” and “change whirl.”
Now it's your turn!
Paint a new sprite for your company name or other text.
Add code to create clones in a loop and to create behavior and effects for each of them.
Most importantly, add a "when flag clicked" event or a “broadcast” block with a matching
"when I receive" block at the top of the create clone stack to make your clones display!