Skip to content

five-on-it / packages/ai/src/police-snipers / sniperRoof

Function: sniperRoof() ​

sniperRoof(level, at, taken): RoofSpot | undefined

Defined in: packages/ai/src/police-snipers.ts:200

The roof a sniper takes for a player at at: of the roofs within SNIPERS.reach, SNIPERS.minHeight over the ground under the player and not taken (no sniper within SNIPERS.apart), a reachable one first, then the tallest, then the nearest; at its edge toward the player, so its eye sees down past it. undefined with none.

Parameters ​

level ​

LevelData

at ​

x ​

number

y ​

number

z ​

number

taken ​

readonly object[]

Returns ​

RoofSpot | undefined