A bunch of random utils for game development in js.
A* Search algorithm implementation.
Kind: global class
Reset astar runner so you can use a diff graph, start or goal.
Kind: instance method of AStar
Param |
---|
graph |
start |
goal |
Rebuild path from.
Kind: instance method of AStar
Param |
---|
current |
Calculate the heuristic cost.
Kind: instance method of AStar
Param |
---|
start |
goal |
Calculate distance between two nodes
Kind: instance method of AStar
Param | Type |
---|---|
v1 | * |
v2 | * |
Take a single step through the algorithm, this is mostly exposed for doing demos/visualization.
Kind: instance method of AStar
Returns: Boolean
| Array
- A bool indicating it's still running, or an array of the shortest path.
Find the shortest path from one node to another in a graph.
Kind: instance method of AStar
Param |
---|
graph |
start |
goal |