xxxxxxxxxx
29
let w
function setup() {
createCanvas(500, 500);
w = 25
}
function draw() {
background(220);
for (let x = 0; x < width; x += w){
if (mouseX > x && mouseX < (x+w) && x <150 ){
fill(255, 0, 0)
}
else if (mouseX > x && mouseX < (x+w) && x > 150 ){
fill(255, 0, 0)
}
else {
fill(255)
}
rect (x , 0, w, height)
}
}