Search code examples
actionscript-3path-finding

Pathfinding using Bitmap


Where could I find a good as3 class for Pathfinding, using a bitmap?

The white pixels would be traversable and the not white would be obstacles.

So I could find a node, say, at point (34, 33), (starting point), and make a path (setting pixels colors) to the point (300, 240),(ending point).

Thanks.


Solution

  • You could also call getVector() on the BitmapData to extract the pixel information (see link). You just need to find a library for ASTAR that uses an input vector with values of 0 being blocked. If one doesn't exist, it should be fairly easy to update a existing library like http://www.dauntless.be/astar/ to use uint Vector grids.