xxxxxxxxxx
float x;
float y;
float x2 = 300;
float y2 = 300;
float d = 150;
float d2 = 500;
void setup() {
size(screenWidth, screenHeight);
background(240);
}
void draw() {
background(240);
x = mouseX;
y = mouseY;
fill(255);
stroke(200);
ellipse(x2, y2, d2, d2);
if(dist(x, y, x2, y2)<(d/2)+(d2/2)){
fill(255, 0, 0);
stroke(200, 0, 0);
} else {
fill(0, 255, 0);
stroke(0, 200, 0);
}
ellipse(x, y, d, d);
}