Skip to content

1681-engine / index / flowField

Function: flowField() ​

ts
function flowField(
   g, 
   goals, 
   options?
): FlowField;

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

A flow field towards goals (any number: every door out of a burning house), by the same steps, corner rules, costs and end-only tiles findPath takes, so a body following it walks the route findPath would have found. maxCost stops the spread (bodies further off stand still or wander).

Parameters ​

ParameterType
gNavGrid
goalsreadonly TilePoint[]
optionsNavOptions & object

Returns ​

FlowField

Released under the MIT License.