Interface
SentryComp
:The sentry component.
group
Component Types
direction
?: Vec2directionAngle
?: numberfieldOfView
?: numberspotted
: GameObj<any>[]onObjectsSpotted
(cb: (objects: GameObj[]) => void): KEventControllerAttaches an event handler which is called when objects of interest are spotted.
param
cbThe event handler called when objects are spotted.
isWithinFieldOfView
(obj: GameObj<PosComp>, direction?: Vec2, fieldOfView?: number): booleanReturns true if the object is within the field of view.
param
objThe object to test.
param
directionThe direction to look at.
param
fieldOfViewThe field of view in degrees.
hasLineOfSight
(obj: GameObj<PosComp>): booleanReturns true if there is a line of sight to the object.
param
objThe object to test.