Beispiel #1
0
        private void Strategy_Boost()
        {
            if (!Is_On_Line() && CarEnemy.Car.CoverDistance < CarPlayer.Car.CoverDistance)
            {
                if (CarEnemy.Car.CurentBoostCharge >= CarEnemy.Car.MaxBoostCharge)
                {
                    _boostFlag = true;
                }

                if (CarEnemy.Car.CurentBoostCharge <= 0)
                {
                    _boostFlag = false;
                }

                CarEnemy.Boost(_boostFlag);
            }
            else
            {
                CarEnemy.Boost(false);
            }

            // sound animation boost off after overtake
            if (!Is_On_Line() && (CarEnemy.Car.CoverDistance > CarPlayer.Car.CoverDistance && _boostFlag))
            {
                _boostFlag = false;
                CarEnemy.At_Overtake();
            }
        }
Beispiel #2
0
 private void Strategy_Speed()
 {
     if (Is_On_Line() &&
         (CarPlayer.Car.CoverDistance - CarEnemy.Car.CoverDistance < CarPlayer.Width * 2) && // дать рандомное значение привязанное к экрану
         (CarPlayer.Car.CoverDistance - CarEnemy.Car.CoverDistance > 0))
     {
         CarEnemy.Minus_Speed();
         CarEnemy.Boost(false);
     }
     else
     {
         CarEnemy.Plus_Speed();
     }
 }