I am looking for a basic flood fill effect for a turn based game I am working on. Here is some code I am working on, I have distance, but I want to have a color for the radius the player can move suggestions?
public static class Util
{
public static int ManhattanDist(MAP_COORD p1, MAP_COORD p2)
{
return (Mathf.Abs(p1.x - p2.x) + Mathf.Abs(p1.y - p2.y));
}
// The diagonal manhattan distance is the distance
// between coordinates assuming we can traverse
// the grid diagonally as well as orthogonally
public static int DiagonalManhattanDist(MAP_COORD p1, MAP_COORD p2)
{
return (Mathf.Max(Mathf.Abs(p1.x - p2.x), Mathf.Abs(p1.y - p2.y)));
}
}
Here is an example I am trying to recreate.