xxxxxxxxxx
38
function setup() {
createCanvas(400, 400);
frameRate(30);
}
function draw() {
background(220);
noStroke();
if (mouseX < 200 && mouseY < 200){
fill(255,0,50);
rect(0,0,width/2,height/2);
} else if (mouseX > 200 && mouseY < 200){
fill(0,255,50);
rect(width/2,0,width/2,height/2);
} else if (mouseX > 200 && mouseY > 200){
fill(255,0,50);
rect(width/2,height/2,width/2,height/2);
} else if (mouseX < 200 && mouseY > 200){
fill(255,0,50);
rect(0,height/2,width/2,height/2);
}
print(mouseX, mouseY);
}
// if (condition 1) {
// execution 1
// } else if (condition 2) {
// execution 2
// }