Pathfinding engine for Tile Based world

Hi evryone,

I’m kind off new here butt still, I wanted to show you guys something I’ve made for a new game of mine. Most of you probably know it: the pathfinding engine called A*. (Actually it’s not completly A* since I don’t use a closed list).

The engine consists of 3 classes: Tile, Astar and BinaryHeap.
I tried to build it so that other people can easily use the classes. It could be that there’s already another, faster A* engine for flash posted here, but I didn’t really found one…

All the classes (including documentation) are in the attached zip.


Since I wanted to keep it as dynamicle as possible, there isn’t a single graphical ellement in the entire class. The best way to add your own graphical ellements is to extend the Tile class. Fe to this:
[AS]class GameTile extends be.dauntless.Astar.Tile

    private var root:MovieClip;
    private var mc:MovieClip;
    private static var depth:Number = 0;
    public function GameTile(x:Number, y:Number, cost:Number, root:MovieClip)
            super(x, y, cost);
            this.root = root;
            mc = root.attachMovie("mc_test", "mc"+x+"_"+y, depth++);
            mc._x = x * mc._width;
            mc._y = y * mc._height;
            mc.costt.text = cost;
    public function notice():Void


There’s a list of properties and methods in the documentation files so watch out that you don’t overwright any of those… Exept one: notice() . Notice is invoked automaticly when the path is build. It lets the Tile know that it’s in the found path. (And make sure you call the constructor of the Tile class with Super(x, y, cost)).

I hope to get good replies but just be as honest as you can :). I’m pretty proud of it since it’s going pretty fast, but I’m sure a lot of you can do this too…

(Note: Do not judge by the look of the tiles since the engine is pure As, no graphical ellements what so ever! These tiles where just created (using the method above) to give you an example of my project.)