xxxxxxxxxx
float xPos, yPos;
float xFly, yFly;
int score;
void setup() {
size(600,600);
xFly = random(0, width);
yFly = random(0, height);
}
void draw() {
background(176, 181, 176);
xPos = lerp(xPos, mouseX, 0.1);
yPos = lerp(yPos, mouseY, 0.1);
textSize(40)
textAlign(CENTER,CENTER);
text("🕷",xPos, yPos);
textSize(20);
text("🪰", xFly, yFly);
if (dist(xPos,yPos, xFly,yFly) <20) {
xFly = random(0,width);
yFly = random(0,height);
score += 1;
print (score);
}
if (millis() > 60000) exit();
}