xxxxxxxxxx
26
let oDiam = 80;
let mDiam = 40;
let x0 = 80;
let y0 = 135;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(220, 10, 120);
fill(255);
stroke(0);
ellipse(x0, y0, oDiam);
let d = sqrt((mouseX - x0) ** 2 + (mouseY - y0) ** 2);
if (d < oDiam / 2 + mDiam / 2) {
fill(255, 0, 0);
}
ellipse(mouseX, mouseY, mDiam);
}