Closed Benny- closed 7 years ago
So I'm imagining the distance function taking two valid locations and returning a path that traverses the Fixed2dArray. The path's length is the Distance. Is this what your imagining?
My use case only requires the distance between those points as an integer. Regardless, what you propose would be a excellent solution for my problem. The function name might need to be called something else, like findRoute(), findPath() or something else.
While you may only need the integer, the integer needs to reflect that diagnol movements were not considered in calculating that integer.
If pathfinding is necessary to derive the integer you need, perhaps you should look into the npm module Pathfinding and feed it the data stored in your Fixed2DArray. The module implements many common algorithms and operates over 2d arrays.
That would be a excellent solution and would invalidate this feature request. Thanks for pointing me in the right direction.
This is a feature request to add a distance function.
It calculates the distance between two points on the grid.
In my specific use case diagonal tiles are not bordering and should not be counted.