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.

Choisir une extension
Modifie ton circuit
Ajoute un bouton qui change l'arrière-plan circuit.
Changement de costume
Change l'apparence des coureurs lorsqu'une touche est appuyée.
Appuie sur le champignon (Part 1 of 2)
Change la façon dont les coureurs se déplacent, puis fais-les ralentir sur l'herbe.
Appuie sur le champignon (Part 2 of 2)
Change la façon dont les coureurs se déplacent, puis fais-les ralentir sur l'herbe.
Bruitages d'accident
Joue un bruitage d'accident chaque fois que les coureurs se percutent.
Supporters
Programme un lutin pour qu'il effectue un compte à rebours pour le départ de la course et qu'il encourage les coureurs.
Trace de couleur
Ajoute un effet de trace de couleur aux coureurs.
arrow_backward Retour
Suivant arrow_forward
Instructions
  1. Choisis une extension, et clique sur le bouton "Regarder" pour découvrir comment la créer.
  2. Quand tu as fini, reviens à l'écran des extensions et essaies-en une autre !