Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Pathfinder

A pathfinder which implements the A* pathfinding algorithm.

Hierarchy

  • Pathfinder

Index

Constructors

constructor

Properties

Private nodes

nodes: Node[]

Private w

w: number

Methods

destroy

  • destroy(): void

findPath

  • findPath(start: Point, end: Point): Promise<Point[]>
  • Finds a path from the start to the end and returns a list of points in between.

    Parameters

    • start: Point

      The start point.

    • end: Point

      The end point.

    Returns Promise<Point[]>

Private getDistance

  • getDistance(nodeA: Node, nodeB: Node): number

Private getIndex

  • getIndex(x: number, y: number): number

Private getNeighbors

Private getPosition

  • getPosition(index: number): object

Private retracePath

  • retracePath(start: Node, end: Node): Point[]

Private simplifyPath

  • simplifyPath(path: Node[]): Point[]

updateWalkableNodes

  • updateWalkableNodes(updates: NodeUpdate[]): void

Generated using TypeDoc