There's a ton of ways you could do this.
None of them are super easy to do though. It will take some optimization to make it fast.
You've basically got two equations you can use to draw a circle, plus the bresenham circle algorithm, but I'm not gonna explain that. :-)
The first is to use the cartesian to polar coordinates equations:
X = Radius * Cos(Angle)
Y = Radius * Sin(Angle)
For a circle of a specific radius, you can use that to find all points around the border of the circle.
Or, you can rearrange the equation to find the two X coordinates for the edges of the circle at a particular Y coordinate. Which is what you would want to do to "rasterize" a circle so you can draw it with a series of horizontal lines on the screen. Or as an outline.
Another way to calculate a circle is to use the distance equation:
RadiusSquared = Radius*Radius
DistanceSquared = ((CX-X)*(CX-X) + (CY-Y)*(CY-Y))
If (DistanceSquared < RadiusSquared) Then this pixel is inside the circle.
CX, CY is the location of the center of the screen.
You can do that for each pixel of the screen, decreasing the radius each time, and if the radius is greater than a certain value, or between a set of values, you can set the pixel black.
This might be the easiest method for you to implment.
If you want to do this, then what you'd do is first find the distance from the center of the screen to the pixel in the corner of the screen. This is the largest you need to draw your circle.
You only need the square of the distance, so just go:
CornerDistanceSquared = ((GraphicsWidth()/2)^2 + (GraphicsHeight/2)^2)
You'll note this is a ltitle diffrent from the distance equation above. That's cause I decideed to get the location of the 0,0 corner pixel, which allowed me to simplify the equation.
Once you have that corner distance, you know the largest you need to draw your circle. This is the radius at which you start drawing an outline circle.
So what you do then is you set Radius to this value. Then for each pixel in the screen, do this:
InnerRadiusSquared# = (Radius#-0.5)*(Radius#-0.5)
OuterRadiusSquared# = (Radius#+0.5)*(Radius#+0.5)
DistanceSquared# = ((CX-X)*(CX-X) + (CY-Y)*(CY-Y))
If (DistanceSquared# > InnerRadiusSquared#) and (DistanceSquared# < OuterRadiusSquared) Then set this pixel to be black.
And then you just keep decreasing the radius one unit at a time.
What this does is it fills pixels which are between an inner radius and an outer radius. You need to fill pixels within two radiuses rather than just at the radius because if you just fill at the radius some pixels will be missed. This will ensure that as you draw circles of decreasing size that the circles will fill all the pixels. You may even be able to use a value of less than 0.5 for the radius size. If you can then you will fill fewer pixels extra times and the algorithm will go faster.
This isn't the fastest way to do it, but it should be fast enough for your needs.
None of them are super easy to do though. It will take some optimization to make it fast.
You've basically got two equations you can use to draw a circle, plus the bresenham circle algorithm, but I'm not gonna explain that. :-)
The first is to use the cartesian to polar coordinates equations:
X = Radius * Cos(Angle)
Y = Radius * Sin(Angle)
For a circle of a specific radius, you can use that to find all points around the border of the circle.
Or, you can rearrange the equation to find the two X coordinates for the edges of the circle at a particular Y coordinate. Which is what you would want to do to "rasterize" a circle so you can draw it with a series of horizontal lines on the screen. Or as an outline.
Another way to calculate a circle is to use the distance equation:
RadiusSquared = Radius*Radius
DistanceSquared = ((CX-X)*(CX-X) + (CY-Y)*(CY-Y))
If (DistanceSquared < RadiusSquared) Then this pixel is inside the circle.
CX, CY is the location of the center of the screen.
You can do that for each pixel of the screen, decreasing the radius each time, and if the radius is greater than a certain value, or between a set of values, you can set the pixel black.
This might be the easiest method for you to implment.
If you want to do this, then what you'd do is first find the distance from the center of the screen to the pixel in the corner of the screen. This is the largest you need to draw your circle.
You only need the square of the distance, so just go:
CornerDistanceSquared = ((GraphicsWidth()/2)^2 + (GraphicsHeight/2)^2)
You'll note this is a ltitle diffrent from the distance equation above. That's cause I decideed to get the location of the 0,0 corner pixel, which allowed me to simplify the equation.
Once you have that corner distance, you know the largest you need to draw your circle. This is the radius at which you start drawing an outline circle.
So what you do then is you set Radius to this value. Then for each pixel in the screen, do this:
InnerRadiusSquared# = (Radius#-0.5)*(Radius#-0.5)
OuterRadiusSquared# = (Radius#+0.5)*(Radius#+0.5)
DistanceSquared# = ((CX-X)*(CX-X) + (CY-Y)*(CY-Y))
If (DistanceSquared# > InnerRadiusSquared#) and (DistanceSquared# < OuterRadiusSquared) Then set this pixel to be black.
And then you just keep decreasing the radius one unit at a time.
What this does is it fills pixels which are between an inner radius and an outer radius. You need to fill pixels within two radiuses rather than just at the radius because if you just fill at the radius some pixels will be missed. This will ensure that as you draw circles of decreasing size that the circles will fill all the pixels. You may even be able to use a value of less than 0.5 for the radius size. If you can then you will fill fewer pixels extra times and the algorithm will go faster.
This isn't the fastest way to do it, but it should be fast enough for your needs.