SentryComp:
The sentry component.
direction?: Vec2
directionAngle?: number
fieldOfView?: number
spotted: GameObj[]
onObjectsSpotted(cb: (objects: GameObj[])=>void): KEventController
Attaches an event handler which is called when objects of interest are spotted.param
isWithinFieldOfView(obj: GameObj, direction?: Vec2, fieldOfView?: number): boolean
Returns true if the object is within the field of view.param
hasLineOfSight(obj: GameObj): boolean
Returns true if there is a line of sight to the object.param