I just started using processing a couple of days ago and started experimenting with loops. I’ve created some coding that would draw a circle within a circle and successively get small. I want to create a loop that draws these circles across and down the screen but I am confused on how to do that. the code I have created is very repetitive with only the position of the circles changing. I really need some help.
You’re doing this is way that could work, but is a little weird.
Your approach is:
Draw a bunch of large dark circles.
Then draw a bunch of smaller, slightly lighter circles on top of them.
Then draw a bunch of even smaller, even more slightly lighter circles on top of them.
Then draw a bunch of even more smaller, even more slightly lighter circles on top of them.
And… that works.
But you could also do it this way:
Draw the first circle first, and then the smaller circle on top of it, and the second one on top of it, and the third one on top of it. So the first circle is completely done.
Move to where the next circle is and do the same thing.
In short, I would suggest you just get one complete circle working first! Don’t worry about loops that do positions. Just worry about loops that deal with the size of the circles and the color of the circles… for one complete circle.
Once you have one of them working, you can move it into a function to call to draw the complete circle at any position you like. Then you can worry about loops that change positions.