The sentry component.
groupComponents
subgroupComponent Types
The direction the sentry is pointing to.
The direction of the sentry as an angle in degrees.
The field of view of the sentry in degrees.
The objects spotted most recently.
onObjectsSpotted(cb: (objects: GameObj[] )=>void ): KEventController
Attaches an event handler which is called when objects of interest are spotted.
paramcb- The event handler called when objects are spotted.
isWithinFieldOfView(obj: GameObj , direction?: Vec2 , fieldOfView?: number ): boolean
Returns true if the object is within the field of view.
paramobj- The object to test.
paramdirection- The direction to look at.
paramfieldOfView- The field of view in degrees.
Returns true if there is a line of sight to the object.
paramobj- The object to test.