xxxxxxxxxx
21
var xcor = 80;
var ycor = 30;
var wt = 80;
var ht = 60;
function setup() {
createCanvas(240, 120);
}
function draw() {
background(220);
if ((mouseX > xcor) && (mouseX < xcor + wt) &&
(mouseY > ycor) && (mouseY < ycor + ht)) {
fill(0);
} else {
fill(255);
}
rect(xcor, ycor, wt, ht);
}