Color changing flower screen saver

im trying to make a color changing flower screen saver for my mom as a assignment i have to do but im using ellipses and cant figure out how to make the ellipse rotate more than once in the exact same spot it was in last time can you guys help me?pls

void setup() {
size(500,500);
frameRate(1);
}
float z = 90;
color aColor = color(random(0,255),random(0,255),random(0,255));
color bColor = color(random(0,255),random(0,255),random(0,255));
color cColor = color(random(0,255),random(0,255),random(0,255));
color dColor = color(random(0,255),random(0,255),random(0,255));
color eColor = color(random(0,255),random(0,255),random(0,255));
color fColor = color(random(0,255),random(0,255),random(0,255));
color gColor = color(random(0,255),random(0,255),random(0,255));
color hColor = color(random(0,255),random(0,255),random(0,255));
color iColor = color(random(0,255),random(0,255),random(0,255));
color jColor = color(random(0,255),random(0,255),random(0,255));
color kColor = color(random(0,255),random(0,255),random(0,255));
color lColor = color(random(0,255),random(0,255),random(0,255));
color mColor = color(random(0,255),random(0,255),random(0,255));
color nColor = color(random(0,255),random(0,255),random(0,255));
void draw() {
translate(width/2,height/2);
background(0, 200, 255);
fill(0,180,0);
rect(-10,20,20,100);
fill(132,0,48);
ellipse(0,0,50,50);
fill(aColor);
stroke(bColor);
rotate(z);
{z += 180;
if (z > 280);{
z = 90;
}
ellipse(0,0,30,80);
}
}

Hi
Welcome

Here is how to use rotate

https://funprogramming.org/30-Multiple-rotating-objects-and-reset-matrix.html

Hi!
I have a few suggestions for your code! It could make the code shorter faster and better!

otherwise, you can always check out the processing reference!

1 Like

@williammannisto note that using frameRate(1) making execution very slow

void setup() {
size(500,500);
frameRate(1);
}
1 Like