Skip to content

1681-engine / index / floodFill

Function: floodFill() ​

ts
function floodFill(
   g, 
   from, 
   options?
): Float32Array;

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

Walking cost from one tile to every tile of the grid (row-major, Infinity where unreachable), by the same steps and costs findPath takes — for weighing several destinations by real distance rather than by a straight line. An end-only tile gets a cost (it can be stepped onto) but nothing is reached through it. maxCost stops the spread.

Parameters ​

ParameterType
gNavGrid
fromTilePoint
optionsNavOptions & object

Returns ​

Float32Array

Released under the MIT License.