Skip to content

1681-engine / index / followFlow

Function: followFlow() ​

ts
function followFlow(
   agent, 
   field, 
   tileSize, 
   maxSpeed
): SteerVec;

Defined in: src/nav/steering.ts:124

Full speed along a flow field from the tile the body stands on. On a goal it brakes to a stop, so a crowd gathers there rather than coasting past. Pushed off the field (into a wall, off the grid, by a crowd's shoving), it heads for the cheapest tile around it that is on the field, so it is never stranded; with none within two tiles, it brakes.

Parameters ​

ParameterType
agentSteerAgent
fieldStepSource
tileSizenumber
maxSpeednumber

Returns ​

SteerVec

Released under the MIT License.