xxxxxxxxxx
33
function setup() {
createCanvas(600, 400);
}
function draw() {
background(220);
//if my mouse is in the left column
if (mouseX <200) {
fill('red');
rect(0,0,200,height);
fill('white');
rect(200,0,200,height);
fill('white');
rect(400,0,200,height);
}
if (mouseX>200 && mouseX<400) {
fill('white');
rect(0,0,200,height);
fill('red');
rect(200,0,200,height);
fill('white');
rect(400,0,200,height);
}
if (mouseX >400 && mouseX<600) {
fill('white');
rect(0,0,200,height);
fill('white');
rect(200,0,200,height);
fill('red');
rect(400,0,200,height);
}
}