Skip to content

1681-engine / index / followField

Function: followField() ​

ts
function followField(
   field, 
   from, 
   maxSteps?
): TilePoint[] | null;

Defined in: src/nav/flowField.ts:90

The tiles a body at from walks by following the field, to the goal (both ends included), or null when from is out of reach. For drawing the route, and for tests; a body steps one tile at a time with stepAt.

Parameters ​

ParameterType
fieldFlowField
fromTilePoint
maxStepsnumber

Returns ​

TilePoint[] | null

Released under the MIT License.