xxxxxxxxxx
41
function setup() {
createCanvas(400, 400);
rectMode(CENTER);
}
function draw() {
background(220);
fill(170);
rect(200, 200, 150, 350);
if (mouseY > 150 && mouseY < 250 && mouseX < 250 && mouseX > 150)
fill("yellow");
else {
fill(255);
}
ellipse(width / 2, height / 2, 100, 100);
if (mouseY > 50 && mouseY < 150 && mouseX < 250 && mouseX > 150)
fill("red")
else {
fill(255);
}
ellipse(width / 2, height / 2 - 115, 100, 100);
if (mouseY > 250 && mouseY < 365 && mouseX < 250 && mouseX > 150) {
fill("green");
} else {
fill(255);
}
ellipse(width / 2, height / 2 + 115, 100, 100);
print(mouseX, mouseY);
}