Skip to content

formationPoints beta ​

Function of @v12-engine/engine

ts
export declare function formationPoints(world: World, units: readonly Entity[], target: Vec2, formation?: FormationDef, facing?: number): Map<EntityId, Vec2>;

Individual destinations for a group ordered to the same point, in a formation (rowsFormation when none is given), and what the formation hook makes of them. Units that walk and units that fly are laid out apart, each on their own navigation (world.navFor). facing, where the player turned the formation by hand, is the way it faces (a direction as an entity's facing is), over the way of travel