clik-engine API
    Preparing search index...

    Function findPath

    • A* pathfinding on a Grid2D. Returns a path from start to goal, or empty array if no path exists.

      Type Parameters

      • T

      Parameters

      • grid: Grid2D<T>

        The grid to pathfind on

      • isWalkable: (value: T, x: number, y: number) => boolean

        Function that returns true if a cell is walkable

      • start: PathNode

        Start position

      • goal: PathNode

        Goal position

      • diagonal: boolean = false

        Allow diagonal movement

      Returns PathNode[]