Time for action – breaking out of the circle
Not all of our art needs to create a circle, and just to prove it, the following is a quick example:
- For this pattern, we'll use a variable called
counter
as both a way to control the number of times to repeat the pattern and a multiplier for the ever-changing x and y coordinates. Create the variable, if you don't have one in your current project. - Set the initial values for the pattern as shown in the following set of blocks:
- set (counter) to (0)
- clear
- hide
- set pen size to (1)
- Add a repeat () until block and use the condition (counter) > (25) as the value. Repeat the following set of blocks:
- pen up
- go to x: ((counter) * (10) y: (0)
- pen down
- go to x: (0) y: (250) – ((counter) * (10))
- change (counter) by (1)
- The resulting pattern should match the following screenshot:
What just happened?
The key to this pattern is the use of the counter
variable as a multiplier. The pattern starts at (0, 0) and moves right along the x axis in increments...