Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RangeFinder

Used to find a range from a central point, like movement or ranged attacks in turn-based games. This uses a search similar to Dijkstra or AStar, but returns a list of tiles in range of a starting point, rather than a path to a goal.

Hierarchy

  • RangeFinder

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Readonly topology

topology: "four" | "eight"

Methods

compute

  • compute(config: { maxRange: number; minRange?: undefined | number; start: Vector2 }): RangeVector2[]
  • Find the range from a given point.

    Parameters

    • config: { maxRange: number; minRange?: undefined | number; start: Vector2 }

      Configuration for the findRange

      • maxRange: number

        The maximum range allowed

      • Optional minRange?: undefined | number

        The minimum range allowed (optional)

      • start: Vector2

        Vector2 - The starting point

    Returns RangeVector2[]

    • RangeVector2[] ({x,y,r}[])

Generated using TypeDoc