xxxxxxxxxx
21
let sqn;
function setup() {
createCanvas(windowWidth, windowHeight);
sqn = 100;
}
function draw() {
background(220);
fill(255);
for (let i=0; i < sqn; i++){
if (mouseX > width/sqn*i && mouseX < width/sqn*(i+1)){
fill(255,0,0);
rect(width/sqn*i, 0, width/sqn, height);
} else {
fill(255);
rect(width/sqn*i, 0, width/sqn, height);
}
}
}