UNPKG

grid-engine

Version:

Phaser3 plugin for grid based movement on a 2D game board.

30 lines (29 loc) 1.16 kB
import { GridTilemap } from "../../GridTilemap/GridTilemap.js"; import { CharId, GridCharacter } from "../../GridCharacter/GridCharacter.js"; import { Movement, MovementInfo } from "../Movement.js"; import { Direction, IsPositionAllowedFn, ShortestPathAlgorithmType } from "../../GridEngine.js"; import { NoPathFoundStrategy } from "../../Pathfinding/NoPathFoundStrategy.js"; export interface Options { distance?: number; noPathFoundStrategy?: NoPathFoundStrategy; maxPathLength?: number; shortestPathAlgorithm?: ShortestPathAlgorithmType; ignoreLayers?: boolean; considerCosts?: boolean; facingDirection?: Direction; isPositionAllowedFn?: IsPositionAllowedFn; ignoredChars?: CharId[]; } export declare class FollowMovement implements Movement { private character; private gridTilemap; private charToFollow; private targetMovement?; private options; constructor(character: GridCharacter, gridTilemap: GridTilemap, charToFollow: GridCharacter, options?: Options); init(): void; update(delta: number): void; getInfo(): MovementInfo; private getFacingPos; private updateTarget; }