PatrolComp:

waypoints: Vec2[] | undefined

Path to follow. If null, doesn't move.

patrolSpeed: number

Speed of the movement during patrol.

nextLocation: Vec2 | undefined

Current subgoal, if any.

onPatrolFinished(cb: (objects: GameObj[] )=>void ): KEventController

Attaches an event handler which is called when using "stop" and the end of the path is reached.

paramcb- The event handler called when the patrol finishes.