xxxxxxxxxx
33
let rectShow = false;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
if (mouseX < width/3 && pmouseX < width/3) {
rectShow = !rectShow;
}
else if (rectShow) {
fill("red");
}
else {
fill(255);
}
rect(0, 0, width/3, height);
}
// rect(x, 0, x, y);
// rect(x*2, 0, x, y);