Пример #1
0
 private void idleState(float delta, Vector2 Knockback)
 {
     Velocity = Velocity.MoveToward(Vector2.Zero, Friction * delta);
     seekPlayer();
     if (wanderController.GetTimeLeft() == 0)
     {
         state = pickRandomState(new Global.BehaviorState[] { Global.BehaviorState.STATE_IDLE, Global.BehaviorState.STATE_WANDER });
         Random r = new Random();
         wanderController.StartWanderTimer(r.Next(1, 4));
     }
 }
Пример #2
0
 private void RestartWander()
 {
     if (wanderController.GetTimeLeft() == 0)
     {
         state = PickRandomState(stateArray);
         wanderController.StartWanderTimer(rng.RandfRange(1, 3));
     }
 }
Пример #3
0
 private void SetNextStateIfWanderTimerFinished()
 {
     if (_wanderController.GetTimeLeft() != 0)
     {
         return;
     }
     _state = GetRandomState(new List <EnemyState> {
         EnemyState.Idle, EnemyState.Wander
     });
     _rng.Randomize();
     _wanderController.StartWanderTimer(_rng.RandfRange(1, 3));
 }