Looking for a quick formula to fill the xy's of a circle.
I can do it with sin cos, but I can't think of a way to do it without having some actions repeated unnecessarily.
Barring that a formula to fill a polygon might work.
You could use y=sqrt(r^2-(X-a)^2)+b where a,b is the center and r is the radius. That would give the equation for the top half of the circle. Make the sqrt negative to get the bottom half. There's an example of this in some terrain destruction using tilemaps elsewhere on the forum.
Or you could just loop over all the pixels and draw the pixel if this is true:
Replace X with (X-a) and y with (y-b) if you want to center the circle at a,b instead of 0,0.
Develop games in your browser. Powerful, performant & highly capable.
Ahh that worms using tilemaps example from way back.