xxxxxxxxxx
29
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
let half = 200;
if (mouseX < half && mouseY < half) {
fill(100,200,0);
square(0,0,half);
}
if (mouseX > half && mouseY < half) {
fill(200,100,0);
square(half,0,half);
}
if (mouseX < half && mouseY > half) {
fill(0,100,200);
square(0,half,half);
}
if (mouseX > half && mouseY > half) {
fill(200,0,100);
square(half, half,half);
}
}