void setup() { size(1000,1000); fill(255); rect(0,0,1000,1000); } int gety=0; int getx=0; int feld=10; float mouseovery=0; float mouseoverx=0; int a=128; int b=128; int c=128; int save=0; int sumlx=0; int sumly=0; void draw(){ mouseovery = mouseY; mouseoverx = mouseX; noStroke(); if(a<20) a=a+(int)random(0,20); if(a>235) a=a+(int)random(-20,0); a=a+(int)random(-20,20); if(b<20) b=b+(int)random(0,20); if(a>235) a=a+(int)random(-20,0); b=b+(int)random(-20,20); if(c<20) c=c+(int)random(0,20); if(a>235) a=a+(int)random(-20,0); c=c+(int)random(-20,20); gety= (int)mouseovery; getx=(int)mouseoverx ; sumlx=floor(getx/feld); sumly=floor(gety/feld); if (mousePressed && (mouseButton == LEFT)) { fill(a,b,c); rect(sumlx*feld,sumly*feld,feld,feld); save=1; } if (mousePressed && (mouseButton == RIGHT)&&save==1) { fill(255); rect(0,0,1000,1000); } }