melonJS
    Preparing search index...

    Interface PathOptions

    how a search goes, for Grid#findPath, Grid#getIdPath and Grid#getPointPath

    interface PathOptions {
        allowPartialPath?: boolean;
        avoid?: Iterable<Readonly<{ x: number; y: number }>, any, any>;
        avoidWeight?: number;
        diagonalMode?: DiagonalMode;
        heuristic?: Heuristic;
        maxNodes?: number;
        smooth?: boolean;
        trace?: boolean;
    }
    Index
    allowPartialPath?: boolean

    When the goal cannot be reached (blocked, walled off, or past maxNodes), return the path to the cell nearest to it instead of an empty one.

    false
    
    avoid?: Iterable<Readonly<{ x: number; y: number }>, any, any>

    Points to keep away from, for this search only: other agents, a hazard. In world units for Grid#findPath, in cells for the others. The start and the goal are never avoided, nor is a point off the grid.

    avoidWeight?: number

    What entering an avoided cell costs on top of its own weight: 0 or more, Infinity to block it.

    Infinity
    
    diagonalMode?: DiagonalMode

    when the path may move diagonally, for this search

    the grid's Grid#diagonalMode

    heuristic?: Heuristic

    the estimate of the distance left, for this search

    the grid's Grid#heuristic

    maxNodes?: number

    The most cells the search looks at before it gives up, 0 or more, so a goal that cannot be reached does not stall a frame.

    Infinity
    
    smooth?: boolean

    Straighten the path: drop the points between two that can see each other in a straight line over open cells, so an agent heads straight there instead of stepping tile by tile. The line keeps to cells no heavier than the ones it replaces, so it never cuts through mud the search went around.

    false
    
    trace?: boolean

    Keep the cells the search looked at, in order, in result.trace: for a debug view (Grid#findPath only).

    false