This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Pathfinding using the A* Algorigthm: By Greg Felber | |
This function is used to determine the quickest path from a starting node to a target node via a connected | |
series of nodes. | |
The A* Algorithm begins by checking to see the visible waypoints of the starting node. These connected nodes | |
will be known as its neighbors. Each neighbors cost "F" will be calculated by summing the distance between | |
the starting node to the best point, "G", and the best point to the target node, "H". The neighbor with the lowest | |
cost is selected as the best node and added to the array of closed nodes and removed from the list of open nodes |