# Circles Using Square Grid

**URL:** https://forum.kirupa.com/t/circles-using-square-grid/323080
**Category:** flash
**Created:** [June 15, 2011, 11:02pm UTC](https://forum.kirupa.com/t/circles-using-square-grid/323080 "2011-06-15T23:02:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![selacius](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@selacius](https://forum.kirupa.com/u/selacius)
#### Post date: [June 15, 2011, 11:02pm UTC](https://forum.kirupa.com/t/circles-using-square-grid/323080/1 "2011-06-15T23:02:55Z")

</div>

I am making a tile-based battle engine for my tile-based RPG. I am hoping to make skill effects have a range cloud (circular) and when the player selects a skill which has a range cloud associated with it (range of 5 for example), an array (two-dimensional) will be created with the filled in values resembling the circle.

Eg.  
Range = 5;  
Therefore array will go from x - 5 to x + 5 and y - 5 to y + 5, where x,y resemble the coordinates of the center of the circle. Now this would give me a 10x10 box, however in the indexes that land within the circle, I would place a value that refers to being within the circle.

My question is, does anyone have experience creating this type of algorithm? I know how to create the array, etc. But I am not sure how to make it so I can create a circle from the square tiles.  
Thanks
