int x=60, y=80, w=120, h=60, sx=0, score=0; float r_x=random(0,240), r_y=random(0,240); void setup(){ background(0); size(240,240); textSize(30); textAlign(CENTER); text ("START",120,120); stroke(255); noFill(); rect(60,80,120,60); } void draw(){ float d = dist(mouseX, mouseY,r_x,r_y); if((mousePressed == true) && (mouseX > x) && (mouseX < x+w) && (mouseY > y) && (mouseY < y+h) && (sx == 0)){ background(0); sx++; } if(sx == 1){ stroke(255,0,0); fill(255,0,0); ellipse(r_x,r_y,20,20); } if((sx >= 1) && (d < 20)){ fill(0,255,0); stroke(0,255,0); ellipse(r_x,r_y,20,20); sx++;} if((sx >= 1) && (mousePressed == true) && (d < 20)){ r_x=random(0,240); r_y=random(0,240); background(0); sx=1; score++; } }