Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+4 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 (1 point)
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 (1 point)
selected by
...