In this video, you'll learn how to create many sprites that fly across the screen.
In Scratch, you can create a copy of an object using the "create clone" block. The clonewill have the same attributes and characteristics as the original object.
When you program the computer to create a clone, or copy, of a sprite, you can provideinstructions, or code, for how the copy should look or function. Without instructions, clickingthe "create clone of myself" block will make a clone of the sprite appear on the stage,but the clone will not fly or do any other actions the original sprite performs.
Use the "when I start as clone" event block to provide instructions that will make thenew clone perform an action. Add the "when I start as clone" block, then drag your "goto" and "glide" block stack under this event. Now, whenever you click the "create clone"block, the clone receives instructions telling it to fly across the screen. Clicking "createclone" multiple times makes several clones fly across the screen.
To automate the cloning, drag the "create clone of myself" block into the forever block.
Whoa! That's a lot of clones trying to cross the screen at the same time. Add a "wait"block to the forever loop to slow down the clone creation. Adjust the value in the “wait”block until you like the clone creation pace. Great! You now have several clones zippingacross your screen. But, they don’t disappear when they reach the right side of the screen.
To fix that, add a "delete this clone" block after the “glide” block. You might alsowant to drag your flying sprite to one side of the screen.
Computer scientists like you often need to test several solutions to a tough problembefore they find the one that works. If your code isn't working correctly, keep tryingdifferent fixes until you solve the problem. Now, it's your turn:Add the event "when I start as clone," and place the code that makes your sprite flyunder it. Add "create clone" and "wait" blocks to theforever loop. Add a "delete this clone" block to the bottomof the stack.