Skip to content

five-on-it / packages/world/src/checks / spawnReach

Function: spawnReach() ​

spawnReach(level, layers?): (x, z, y?) => boolean

Defined in: packages/world/src/checks.ts:178

Whether points of a level can be reached from its spawn points: on foot from one free node of the layered navigation (built for a person unless one is given) to the next it is linked to (the ground, stairs, the floors and decks they lead onto; up a ladder or a lift to the floor it reaches), or along a road, whose centre line joins every node it passes over at its own height whatever the grid makes of them. A point counts as reached when a free or road node within two cells of it is: on the ground, or, given its height y (a place on an upper floor), on the floor its own cell has under that height (the highest no more than a metre over it).

Parameters ​

level ​

LevelData

layers? ​

NavLayers = ...

Returns ​

(x, z, y?) => boolean