void setup(){ size (600,400); // the program will run in a window 300px wide and 200px high //fill(255,50); // objects drawn will be filled with white: 0=blk, 255=wht, every num btwn is some shade of gray //noStroke(); // turns off the stroke around drawn objects, otherwise it defaults to blk fill(#666666); noStroke(); // some shade of orange with an "alpha transparency" of 100/255 background(255); // fills the sketch window with black } float xspeed = 2.8; // Speed of the shape float yspeed = 10.2; // Speed of the shape float diam; float x; float y; boolean moving=false; //void mouseMoved() { // if (mouseX >500) { // draw(); // } // } void mouseMoved () { moving=true; } void draw() { diam = random(50); x = random(width); y = random(height); if (moving && mouseX>200 && mouseY>100) { fill(#107EAF);//blue smooth(); ellipse(x,y,diam,diam); } if (moving && (mouseX<100)) { fill(#246D2B,random(255));//green smooth(); rect(x,y,diam,diam); } if (moving && (mouseY>100 && mouseX>50)) { fill(#6D246D,random(255));//purple smooth(); ellipse(x,y,diam,diam); } if (moving && mouseY<100 && mouseX>250) { fill(#F7F777,random(255));//yellow smooth(); ellipse(x,y,diam,diam); } if (mouseY > height || mouseX > width) { background(255); } moving=false; }