In this video, you will make Tera change colors and duplicate itself across the stage.
To do this, use the “change color effect by” block, which is in the looks menu. Clickthis block to test it. Notice that Tera changes colors. Add this block to the forever loop.
When this forever loop runs, tera moves 10 steps, if touching the edge it bounces, pointstowards the mouse pointer and finally changes color effect by 25. Then, the loop runs againfrom the top.
Test this, and tinker with the value of the “change color effect by” block. Noticethat when you change the value to a small number, Tera changes color slowly, and whenthe number is bigger, the sprite changes colors more quickly.
Now that the sprite follows the mouse pointer while it changes color, you can make it drawby stamping each time the loop runs. To do this, drag a “stamp” block from the “pen”menu into the forever loop.
Test it by clicking the block stack. As you move the mouse, a rainbow effect is createdwith different-colored Tera stamps. As you play with the sprite, you may noticethat you do not have a way to clear the screen. Go to the pen menu, and pull out the “clear”block. When you click it, the stamps disappear.
If you were to put that block in the forever loop, Tera will stop stamping.
That is because each time the forever loop runs, Tera moves towards the mouse, changescolors, stamps, and… clears. Well, it shouldn’t clear every time the loop runs.
To fix this, move the “clear” block to the beginning of the program.
Now, each time you click the block stack, the stamps clear, then the loop runs.
At the moment, the only way to start the program is to click the code. To make it easy forother people to use your creation, add a “when green flag is clicked” block.
Now, it’s your turn! 1. Change Tera’s color with the “changecolor effect” block. 2. Stamp repeatedly with a forever loop.
3. Clear the stage when the green flag is clicked.