Making a Trail

Материал из Поле цифровой дидактики
Файл:Sprite trail effect.PNG
Blur/trail effects in a fireworks project.

Trails on sprites create a type of fireworks effect. Trails have the characteristics of following the main sprite's path and fading out. There are two main ways to create this, using the Create Clone of () and Pen Down block.

Clone Method

The clone method is a more straightforward way to create this type of effect. It utilizes the ghost effect.

whenclickedforevercreatecloneofmyselfendwhenIstartasaclonerepeat5Replacethiswithanestimateofhowlongyouwantyourtrailchangeghosteffectby20100dividedbythenumberoftimesrepeatedequalstheghosteffectnumber.Thismakestheclonefadeout.enddeletethisclone

Pen Method

This method works by slowly "blotting out" pen marks by stamping a translucent sprite the size of the background continuously. Place the script below in a sprite the size of the stage and the desired background color. Шаблон:Note

whenclickedgobackwards1layerssetsizeto150gotox:0y:0setghosteffectto20foreverstampend

Place this script in the sprite you want to leave a trail on:

whenclickedforeverstampend