float X,Y; float Cx,Cy; float Ang1,Ang2; float R1,R2; float Rot1,Rot2; void setup(){ size(400,400); colorMode(RGB,100); background(0); noStroke(); frameRate(120); Cx = width / 2; Cy = height / 2; Ang1 = Ang2 = 0; R1 = random(90); R2 = 51; Rot1 = random(3); Rot2 = random(25); } void draw(){ Ang1 += Rot1; Ang2 += Rot2; float rx = Cx + (R1*sin(radians(Ang1)) ); float ry = Cy + (R1*cos(radians(Ang1)) ); X = rx + (R2*sin(radians(Ang2)) ); Y = ry + (R2*cos(radians(Ang2)) ); rectMode(CENTER); fill(randomRGBColor()); smooth(); rect(X,Y,2,2); } void fadeToWhite(){ rectMode(CORNER); fill(0,100); rect(0,0,width,height); } void mousePressed(){ if(mouseButton == LEFT){ R1 = random(50)+20; Rot1 = random(5)+1; Rot2 = random(50)+3; fadeToWhite(); } } color randomRGBColor(){ color c = color(random(256),random(256),random(256)); return c; }