Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

Transcript

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 “when I start as a clone” block to the scripts 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. Whoooaaaa! This is so awesome!! A bunch of clones appear, but they never disappear. To make them disappear, add a “delete this clone” 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 10 times takes longer than changing colors once, you can see the trail effect. Tinker with the 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 trail totally different.

This example shows what combining a “change color effect” and a “change pixelate effect” block creates.

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 this same method to add different trail effects to the other player 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.

Scegli un’estensione
Cambia la tua pista
Aggiungi un pulsante per cambiare lo sfondo della pista.
Cambia il costume
Cambia l'aspetto dei piloti quando viene premuto un tasto.
Piede sul gas (Part 1 of 2)
Modifica la velocità di movimento dei piloti e poi falli rallentare sull'erba.
Piede sul gas (Part 2 of 2)
Modifica la velocità di movimento dei piloti e poi falli rallentare sull'erba.
Suoni di schianto
Riproduci il suono di uno schianto ogni volta che i giocatori si tamponano.
I fan della gara
Programma uno sprite a fare il conto alla rovescia alla partenza della gara e a fare il tifo.
Scia colorata
Aggiungi un effetto scia colorata ai piloti.
arrow_backward Indietro
Avanti arrow_forward
Istruzioni
  1. Scegli un componente aggiuntivo e fai clic su "Guarda" per scoprire come costruirlo.
  2. Quando hai terminato, torna sulla schermata dei componenti aggiuntivi e prova un altro componente aggiuntivo!