Skip to content

Please update your browser

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

3. Color and Stamping

Transcript

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. Click this 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, points towards the mouse pointer and finally changes color effect by 25. Then, the loop runs again from the top.

Test this, and tinker with the value of the “change color effect by” block. Notice that when you change the value to a small number, Tera changes color slowly, and when the 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 draw by 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 created with different-colored Tera stamps. As you play with the sprite, you may notice that 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, changes colors, 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 for other 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 “change color effect” block. 2. Stamp repeatedly with a forever loop.

3. Clear the stage when the green flag is clicked.

arrow_backward Back
Next arrow_forward
Instructions
  1. Make Tera change colors using the "change color effect" block.
  2. Make Tera stamp repeatedly.
  3. Make the stage clear when the green flag is clicked.