In this add-on,
you'll add a colorful trail effect to the racers.
Here's how this effect works.
As the sprite moves forward, it creates clones of itself
that change color, then disappear.
Clones are copies of the sprite that you program
to have a specific behavior or action.
First, select a player sprite, open the control menu
and add a create clone of myself block into the
repeat loop that makes the racer move forward.
Then, add a racer to the clone block to the script's editor.
Any blocks you place after this block
tell the clone what to do.
Click the looks menu, and add a change effect block.
To test this code, click the flag
then press the correct arrow key to move forward.
Whoa, this is so awesome!
A bunch of clones appear, but they never disappear!
To make them disappear, add a delete this block
from the control menu after the change effect block.
Click the stop sign to clear the stage.
Then test the code again.
No clones show up!
After the clones are created, they change color
and delete so fast, you can't see them.
To fix this, add a repeat block
around the change effect block.
Test it out.
Nice! Since changing colors ten times takes longer
than changing colors once, you can see the trail effect.
Tinker with effect to make it your own.``
Change the value in the change effect block
to alter the color effect change.
Add more change effect blocks
to make the effect totally different.
This example shows what combining a change color effect
and a change pixelate effect block makes.
This example combines change color effect
and change ghost effect.
These are just some ideas.
Come up with something totally unique for your game.
Use the same method to add different trail effects
to the other playsr sprite as well.
Now it's your turn.
Create a clone when the player sprite moves forward
using a create clone of myself block.
Make the clone repeat changing colors
then delete itself using change effect,
delete this clone, and repeat blocks.
Tinker with the effect to make it your own
by adding more change effect blocks
and modifying the values.
Add the same effect, or a completely different one
to the second player sprite.
Add a button that changes the racetrack backdrop.
Change what the racers look like when a key is pressed.
Play a crashing sound each time the racers hit each other.
Program a sprite to count down to the start of the race and cheer.
Add a colorful trail effect to the racers.
Sign in to track your progress and earn badges