xxxxxxxxxx
20
function setup() {
createCanvas(600, 600);
}
function draw() {
background(255);
if (mouseX < width / 10) {
fill("red");
rect(0, 0, width / 10, height);
} else if (mouseX < 10 * 2) {
fill("red");
rect(2* width / 10, 0, width / 10, height);
// We are in the room
} else if (mouseX < width) {
// Drawing the third rect
fill("red");
rect(3 * width / 10, 0, width / 10, height);
}
}