Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+3 votes

What are some hints for how to check if a mouseclick is inside of a circle in the window?

asked in CSC201 Spring 2021 by (8 points)
0

You can check the location you are getting from the listener to the location of the circle and compare that.

1 Answer

+2 votes
 
Best answer

If you make a simple distanceFrom funtion (or just put the diatance calculation in each time) you could compare it the getCenter and getRadius circle methods. dragon_game from project 3 has a distance function at the top you could probably recycle.

answered by (8 points)
selected by
...