Click the flag and watch the squirrel draw a tree. Change the values of the four variables and see what effect it has on the shape of the tree:
- leafsize is the size of the leaves (i.e. the minimum line length)
- length is the length of the trunk
- length_factor is the factor by which the lengths of the branches are increased - e.g. if set to 0.5, then each branch is half the length of its parent
- angle is the angle between the branches
- angle_factor is the factor by which the angle increases at each junction - i.e. a value of 1 makes the angle the same at each junction
NB. The tree isn't drawn properly if the beetle hits the edge.
A demonstration of how to use blocks, and an introduction to the idea of binary trees and recursion.
You can hold down the Shift key and click the green flag to enter "Turbo Mode" - that will make the tree appear more quickly.
You don't appear to be able to remix your own projects, so I've created another version called Natural Trees here:
Ready to Remix!
Add your ideas! You could try:
- drawing a new costume
- changing the scripts
- creating a new sprite