Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AStar

AStar is a path finding algorithm that attempts search tiles closer the goal. It estimates a tiles score as the known distance to that tile, plus the distance to goal as the bird flies. It will always first evaluate the tile it knows to currently have the score, and continue from there.

Hierarchy

  • AStar

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Readonly topology

topology: "four" | "eight"

Methods

compute

  • Computes a given path from a start and end point. If not path is found, it will return undefined. Both the start + end points will be returned in the path.

    Parameters

    • start: Vector2

      Vector2 - The starting point

    • end: Vector2

      Vector2 - The ending point

    Returns Vector2[] | undefined

    RangeVector2[] | undefined - Returns the path, including start + end, or undefined if no path is found.

Generated using TypeDoc