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