Per the title, I'm trying to figure out a way to restrict the boundaries of mouseClicked.
I have an image that moves across the screen. When I click on it, it alternates with another image. However, I only want it to alternate when I click within 30 pixels of its current location.
Now I've been trying out event.getX() and event.getY() methods for where I click, and the picture's current location using relational operators and conditional statments.
Is there an easier way to go about this?