Skip to content

Rainbow Blast

The rainbow blast is a series of color-changing circles made up of overlapping squares that decrease in size stacked on top of each other. It sounds complicated when you say it that way, but I think the code might say it complicated-er (is that a word?)

The thing that was challenging about coding this is that I had to make the forward value and the color value decrease with each time the squares made a circle. The rest was actually pretty simple.

I now want to kind of walk you through the code so that you can understand what I mean by, “forward value,” and, “color value decrease.”

So if you look closely here, you can see that there is a yellow block that is called, "forward value." This is called a variable. So at the beginning of my code, you can see that I set my forward value to be 200. Then the code takes the forward value and decreases it by ten. This makes the radius of the circle decrease by ten each time, that way you can see the circles under the one it is drawing. 

We have another variable to change the color here, too. The reason this block is not yellow is because Turtle Art already had a variable created for the pen color. This color variable functions the exact same way that the forward value block did, which results in the color changing with each rotation.

I hope you enjoyed reading this blog post! If you have any questions, put them in the comments and I will be happy to answer. Thank you so much!

Published inUncategorized

One Comment

  1. Absolutely fantastic post. I love the way you broke down the trick to changing colors and your description of how to work with variables. Couldn’t ask for more!

Leave a Reply

Your email address will not be published. Required fields are marked *

Skip to toolbar