Counter that increases with mouse click

I always write it like this:


void mousePressed () {
  if (mouseX>x1 &&
    mouseX<x2 && 
    mouseY>y1 && 
    mouseY<y2 ) {
    counter++;
  }
  println(counter);
}

1 Like