Пример #1
0
        private Critter create()
        {
            Critter critter = null;
            switch (crittersLevel)
            {
                case CritterType.LowLevel: critter = new LowLevel(); break;
                case CritterType.MediumLevel: critter = new MediumLevel(); break;
                case CritterType.HighLevel: critter = new HighLevel(); break;
            }

            critter.Move(critterStartX, critterStartY);

            critter.Texture = Presentation.PresentationController.CritterTexture2D;
            critter.Width = critter.Texture.Width;
            critter.Height = critter.Texture.Height;

            critter.HP += (int)(waveLevel * Constants.CritterLevelHpModifier);
            critter.Speed += waveLevel * Constants.CritterLevelSpeedModifier;
            critter.Points += (int)(waveLevel * Constants.CritterLevelPointsModifier);
            critter.Dexterity += waveLevel * Constants.CritterLevelDexterityModifier;

            critter.Dead = false;
            critter.Active = false;
            critter.Slowed = 0;

            if ((float)RandomHandler.GetRandom() < Constants.CritterUpgradeChance)
            {
                critter.upgradeCritter();
            }

            CrittersList.Add(critter);
            return critter;
        }