Hello,
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.
this is my code:
void setup()
{
size (512,348);
background (255);
}
void draw()
{
float w=width-422;
while (w>0)
{
noStroke();
fill(w);
ellipse(width-462, height-298,w,w);
w=w- 20;}
float a=width-422;
while (a>0)
{
noStroke();
fill(a);
ellipse(147, 50,a,a);
a=a- 20;}
float b=width-422;
while (b>0)
{
noStroke();
fill(b);
ellipse(244, 50,b,b);
b=b- 20;}
float c=width-422;
while (c>0)
{
noStroke();
fill(c);
ellipse(341, 50,c,c);
c=c- 20;}
float d=width-422;
while (d>0)
{
noStroke();
fill(d);
ellipse(438, 50,d,d);
d=d- 20;}
println(mouseX," ",mouseY);
}