Hi, so I got some help earlier on how to place rectangles across the plane in random spots. Now my next question is how i can make the star spin, have the rectangles pop up, and then stop after pressing the mouse again.
void setup(){
size(1360, 1400);
}
void draw() {
fill(41,171,226);
stroke(255);
strokeWeight(2);
beginShape();
vertex(785, 233);
vertex(881,431);
vertex(1098,464);
vertex(939, 617);
vertex(975, 834);
vertex(781, 730);
vertex(586, 831);
vertex(625, 614);
vertex(468, 460);
vertex(686, 430);
endShape(CLOSE);
}
float r = 0;
float g = 0;
float b = 0;
float a = 0;
float X = 0;
float Y = 0;
void mousePressed() {
r = int(random(0, 255));
g = int(random(0, 255));
b = int(random(0, 255));
a = int(random(0, 255));
X = int(random(10, 60));
Y = int(random(10, 60));
fill(r, g, b, a);
rectMode(CENTER);
rect(mouseX, mouseY, X, Y);
}