xxxxxxxxxx
void setup () {
size (400, 400);
}
void draw() {
background (0, 255, 255);
// guide lines to break the screen into quadrants
line (width/2, 0, width/2, height);
line (0, height/2, width, height/2);
fill (0, 0, 0); // make the circles black
// if mouse is in the top left corner, draw a circle there
if ((mouseX < width/2) && (mouseY < height/2)) { // check if mouse is in top left
ellipse(width/4, height/4, 30, 30); // draw ellipse there using width & height
}
// if mouse is in the top right corner, draw a circle there
if ((mouseX > width/2) && (mouseY < height/2)) { // check if mouse is in top right
ellipse(width*3/4, height/4, 30, 30); // draw ellipse there using width & height
}
// if mouse is in the bottom right corner, draw a circle there
if ((mouseX > width/2) && (mouseY > height/2)) { // check if mouse is in bottom right
ellipse(width/2 + width/4, height/2 + height/4, 30, 30); // draw ellipse there using width & height
}
// if mouse is in the bottom left corner, draw a circle there
if ((mouseX < width/2) && (mouseY > height/2)) { // check if mouse is in bottom left
// another way to say height/2+height/4 is height * 3/4, which means height multiplied by 3/4
ellipse(width/4, height*3/4, 30, 30); // draw ellipse there using width & height
}
}