See the code. Basically it just draws a straight line, then changes the angle of the sprite a little bit (angle). And the lines get longer each time. We finish drawing when the line gets to a certain size (limit). That makes a spiral. We lifted that from a Logo tutorial.
Then we draw lots of spirals, starting from where the last one finished. One of the key things was working out when we are finished with the pattern, which is when the angle comes back to 0 when starting a new spiral.
The rest of the stuff is just making the program easier to use, adding fancy colours etc.
Why? Is it the colour? Try setting it to 24 or so.
The drawing algorithm is the same. I've just added some more control now, and clicking on random makes it easier to look for new patterns.
Download the 2 sprites and 5 scripts of "spiral 5" and open it in Scratch
Project Notes
A simple spiral can make fantastic patterns. Change "start", "limit", "angle" and "colour", or press "Random" to see a new pattern. If it hits the side when drawing then the spiral is scaled smaller and smaller until it fits.
Click anywhere to start drawing where you clicked. Press space to start drawing again at the last click. That way you can make a pattern fit in the space without being too small. Press "r" to reset the scaling. If you change any of the spiral settings it resets scaling.
If "colour" is even then colour is related to position on the spiral (looks like a flower); if odd it's related to position in the space (looks like a rainbow).
If you click on a slider to one side of the knob it will adjust the number by 1. That way you can get all the numbers from 1-100.
Comments
You need to be logged in to post comments
Add a Comment
so nerdy
this is very cool!
See the code. Basically it just draws a straight line, then changes the angle of the sprite a little bit (angle). And the lines get longer each time. We finish drawing when the line gets to a certain size (limit). That makes a spiral. We lifted that from a Logo tutorial. Then we draw lots of spirals, starting from where the last one finished. One of the key things was working out when we are finished with the pattern, which is when the angle comes back to 0 when starting a new spiral. The rest of the stuff is just making the program easier to use, adding fancy colours etc.
talk about a novel of instuctions
This is really cool! Makes me dizzy but it's awesome! How did you do it?!
Grrrr I logged in as my friend again! Marshmallow is my friend.
Thanks, Deegee!
Try 67,63,3,58. All sorts of different coloured circles.
Try 31, 50, 4, 46. Compare it to 31, 50, 4, 15. spiral patterns 4 couldn't manage that sort of variation! And I got tired of the "ding dong"....
Why? Is it the colour? Try setting it to 24 or so. The drawing algorithm is the same. I've just added some more control now, and clicking on random makes it easier to look for new patterns.
I like Spiral Patterns 4 better.