// Grouping conditionals: // A big exit button void setup() { size(300,300); background(100,0,0); // Draw the white "exit button" rect(100,0, 100,300); } void draw() { // If mouse is pressed AND x coordinate is bigger than 100 AND smaller than 200 // (the area of the button) if(mousePressed && mouseX>100 && mouseX<200) { exit(); } }