arrow_back Flashy Stuff
In this add-on, create a colorful trail that falls across the stage.
To start, add a new sprite.
This example uses the star sprite, but you can use any sprite you like.
If you’d like, use the shrink tool to make the sprite a smaller size.
First, make the sprite move across the stage.
Move the sprite to the top left of the screen.
This is its starting position.
Drag out a “go to x y” block.
Next, move the sprite to the far right of the stage.
This is its ending position.
Drag out a glide block and attach it under the "go to x y block." Test it out.
The sprite moves from left to right. Tinker with the values.
Drag out a when key pressed block and attach it to the stack. Set the value to “space” in the dropdown menu.
Next, create multiple clones of the sprite as it moves across the screen.
Go to the control menu and drag out a “create clone of myself” block. To make multiple clones, drag out a repeat loop and put it around the “create clone of myself” block.
Attach it to the bottom of the stack. Test it.
The sprite moves across the screen and nothing else seems to happen. However, when you move the sprite, you see only one clone underneath. Actually, you can keep dragging them out.
All of the clones are on top of each other! This happens because the sprite glides for 3 seconds THEN makes the clones. Click on the stop sign to clear the clones.
To create the effect of cloning the sprite as it moves across the stage, go to events, and drag out another when key pressed block. Click on the dropdown to change it to “space” key. Attach the repeat loop to the new block. Test it out. The sprite now moves and creates clones at the same time. Running the two block stacks at the same time is called parallelism.
Tinker with the values of the repeat loop until the sprite makes clones across the stage.
Clear the stage by pressing the stop sign.
Next, program the clones to fall and disappear. From the Control menu, drag out a “when I start as a clone” block. Make the sprite fall using the “change y by” block. Enter in a negative value like -5.
From the control menu, drag out a repeat loop and put it around the change y by block. This will make the sprite look like it's falling. Test it out. All the clones stay on stage.
Drag out a delete this clone block and put it under the repeat loop. Tinker with the values of the repeat block to change how far the sprite falls.
Next, make the sprite change colors. From the looks menu add a “change effect by “ block inside the "repeat" loop. test it out. The clones changes colors and fall across the screen. The last step is to make the original sprite disappear from the top of the stage. Add a “hide” block above the “go to x y” block stack. Add a “show” block under the “when I start as a clone” block.
Now it’s your turn, Make a sprite move across the screen using Go to x y and glide blocks. Create clones using the “Create clone of myself” and “repeat” loops. Make your code stacks run at the same time using “when key pressed” blocks. Program your clones to fall, change color, and disappear using: When I start as a clone, change effect, change y, Delete this clone, and repeat.