I am developing a game where the top left corner of the world is coordinate 0:0. Thus, x is increasing while moving right and y down.
I am trying to come up with an algorithm that finds the coordinates of the tiles within the given circle.
The method signature could look like this:
ArrayOfCoordinates findCoords(int centerX, int centerY, int radius)
Example, if radius is set to 1, it would search something like this:
pic1.jpg 38.93KB 0 downloads
If it is 2:
pic2.jpg 40.89KB 0 downloads
pic3.jpg 44.12KB 0 downloads
pic4.jpg 48.6KB 0 downloads
And so on.