Advanced Turtles
Optional Node
Collapse Content
Show Content
The Turtle Game let you draw pictures. You can use loops and variables to create a complex picture.
Create a Spiral
To create a spiral, we'll increase the distance the turtle walks on each step.
Use the
count with i
block from 1 to 200.
Add 2 blocks inside the loop:
- Move forward by
i
- Turn Right (or Left) by some angle, such as 50 degrees.
- Move forward by
Color Changing Spiral
Let's make the spiral even cooler by adding some color.
- Add a variable
color1
before your loop and assign it a specific color. - Inside the loop, use the special
set colour
block to set the color of the pen to your variablecolor1
. - Use the
colour with
block to change the value of yourcolor1
variable. You can usei
and a math block to change the color by a specific amount each time.
Customize this picture or create your own and share a link to it in the comments below!