Example #1
0
        public void UpdateAction()
        {
            if (_actionCount == 0)
            {
                _agentStatus = AgentStateUtility.RandomFrom(ValidAgentStates);
                switch (_agentStatus)
                {
                case AgentState.Moving:
                    _actionCount = 4;
                    break;

                case AgentState.Halted:
                case AgentState.Knocked:
                case AgentState.Ready:
                    _actionCount = 1;
                    break;
                }
            }
            _actionCount--;

            if (_agentStatus == AgentState.Moving)
            {
                _currentDirection = IsWithinCircularBounds(_playerLocation, Location, 192)
                    ? DirectionUtility.GetDirectionTowardsPoint(Location, _playerLocation)
                    : DirectionUtility.RandomDirection();
            }
            _agentClock = ActionDelay;
        }
Example #2
0
        public void UpdateAction()
        {
            _agentStatus = AgentStateUtility.RandomFrom(ValidAgentStates);
            switch (_agentStatus)
            {
            case AgentState.Moving:
                UpdateDirection(DirectionUtility.RandomDirection());
                _agentClock = ActionDelay;
                break;

            case AgentState.Halted:
                _agentClock = 2 * ActionDelay;
                break;

            case AgentState.Attacking:
                UseAttack();
                _agentClock = BoomerangDuration;
                break;

            case AgentState.Ready:
                break;

            case AgentState.Knocked:
                break;

            default:
                _agentClock = ActionDelay;
                break;
            }
        }
Example #3
0
 public void UpdateAction()
 {
     _agentStatus = AgentStateUtility.RandomFrom(ValidAgentStates);
     if (_agentStatus == AgentState.Moving)
     {
         _currentDirection = DirectionUtility.RandomDirection();
     }
     _agentClock = ActionDelay;
 }
Example #4
0
 public void UpdateAction()
 {
     _agentStatus = AgentStateUtility.RandomFrom(ValidAgentStates);
     if (_agentStatus == AgentState.Moving)
     {
         _currentDirection = Rng.Next(2) == 0
             ? DirectionUtility.GetDirectionTowardsPoint(Location, _playerLocation)
             : DirectionUtility.RandomDirection();
     }
     _agentClock = ActionDelay;
 }
Example #5
0
        private void UpdateAction()
        {
            const int attackScalar = 4;

            _agentStatus = AgentStateUtility.RandomFrom(ValidAgentStates);
            _agentClock  = ActionDelay;

            // ReSharper disable once SwitchStatementMissingSomeCases
            switch (_agentStatus)
            {
            case AgentState.Moving:
                _currentDirection = DirectionUtility.RandomVerticalDirection();
                break;

            case AgentState.Attacking:
                _agentClock *= attackScalar;
                _sprite      = EnemySpriteFactory.Instance.CreateAquamentusFiring();
                break;
            }
        }