Skip to content

1681-engine / index / nearWallCost

Function: nearWallCost() ​

ts
function nearWallCost(g, extra?): (tx, ty) => number;

Defined in: src/nav/navGrid.ts:53

A cost that charges extra for a tile with a wall beside it (four-way), so a route prefers the middle of a clearing to the gap between two obstacles — the narrow way is where an auto-walking body wedges itself. 1.4 was high enough to go round a thicket and low enough to still take a gate.

Parameters ​

ParameterTypeDefault value
gNavGridundefined
extranumber1.4

Returns ​

(tx, ty) => number

Released under the MIT License.