Constructors
constructor
-
Parameters
-
mapWidth: number
-
Optional walkableNodes: NodeUpdate[]
Methods
findPath
- findPath(start: Point, end: Point): Promise<Point[]>
-
Parameters
Returns Promise<Point[]>
Private getDistance
- getDistance(nodeA: Node, nodeB: Node): number
-
Parameters
Returns number
Private getIndex
- getIndex(x: number, y: number): number
-
Parameters
Returns number
Private getNeighbors
-
Parameters
Returns Node[]
Private getPosition
- getPosition(index: number): object
-
Parameters
Returns object
Private retracePath
- retracePath(start: Node, end: Node): Point[]
-
Parameters
Returns Point[]
Private simplifyPath
- simplifyPath(path: Node[]): Point[]
-
Parameters
Returns Point[]
A pathfinder which implements the A* pathfinding algorithm.