Find2d (Astar)
Install
$ npm install find2d
How to use
var astar = ;//Game Area Rectanglevar Rectangle = 002020;//PointA = Start point;var PointA = X:0Y:0//PointB = End point; PointB = X:19Y:19;//Generate Tilesvar t = Astar; var AS = tPointAXPointAY tPointBXPointBY Rectangle; console;
With Collidable Object Rectangle
var astar = ;//Game Area Rectanglevar Rectangle = 002020;//PointA = Start point;var PointA = X:0Y:0//PointB = End point; PointB = X:19Y:19; var Collidable = ;Collidable;Collidable;Collidable; //Generate Tilesvar t = Astar; var AS = tPointAXPointAY tPointBXPointBY Rectangle; console;
By default search method is Horizontal and Vertical for define diagonal search you can change this value and initialise the Tiles
#default value H/Vvar t = Astar;#Diagonal search roadvar t = Astar;