Esempio n. 1
0
        public void Draw(SpriteBatch spriteBatch, GunLevelUnit gunLevel,
                         GunExperienceUnit currentExperience, GunExperienceUnit levelExpereince)
        {
            levelSprite.Draw(spriteBatch,
                             Units.TileToGame(LevelDrawX),
                             DrawY);
            number.number = Convert.ToInt32(gunLevel);
            number.LoadNumber();
            number.Draw(spriteBatch, LevelNumberDrawX, DrawY);
            experienceBarSprite.Draw(spriteBatch,
                                     ExperienceBarDrawX, DrawY);

            if (currentExperience < levelExpereince)
            {
                fillSprite.SetPercentageWidth((float)currentExperience / (float)levelExpereince);
                fillSprite.Draw(spriteBatch, ExperienceBarDrawX, DrawY);
            }
            else
            {
                maxSprite.Draw(spriteBatch, ExperienceBarDrawX, DrawY);
            }

            if (flashTimer.Active && flashTimer.CurrentTime.Ticks / FlashPeriod.Ticks % 2 == 0)
            {
                flashSprite.Draw(spriteBatch, ExperienceBarDrawX, DrawY);
            }
        }
Esempio n. 2
0
 public PolarStar(ContentManager Content)
 {
     sprites = new Dictionary<PolarStarSpriteState, Sprite>();
     currentExperience = 0;
     horizontalProjectiles = new Sprite[Units.MaxGunLevel];
     verticalProjectiles = new Sprite[Units.MaxGunLevel];
     InitializeSprites(Content);
 }
Esempio n. 3
0
 public PolarStar(ContentManager Content)
 {
     sprites               = new Dictionary <PolarStarSpriteState, Sprite>();
     currentExperience     = 0;
     horizontalProjectiles = new Sprite[Units.MaxGunLevel];
     verticalProjectiles   = new Sprite[Units.MaxGunLevel];
     InitializeSprites(Content);
 }
Esempio n. 4
0
 public void DamageExperience(GunExperienceUnit experience)
 {
     currentExperience = Math.Max(0, currentExperience - experience);
 }
Esempio n. 5
0
 public void CollectExpereince(GunExperienceUnit experience)
 {
     currentExperience += experience;
     currentExperience = Math.Min(Experiences[Units.MaxGunLevel], currentExperience);
 }
Esempio n. 6
0
        public void Draw(SpriteBatch spriteBatch, GunLevelUnit gunLevel,
            GunExperienceUnit currentExperience, GunExperienceUnit levelExpereince)
        {
            levelSprite.Draw(spriteBatch,
                Units.TileToGame(LevelDrawX),
                DrawY);
            number.number = Convert.ToInt32(gunLevel);
            number.LoadNumber();
            number.Draw(spriteBatch, LevelNumberDrawX, DrawY);
            experienceBarSprite.Draw(spriteBatch,
                ExperienceBarDrawX, DrawY);

            if (currentExperience < levelExpereince)
            {
                fillSprite.SetPercentageWidth((float)currentExperience / (float)levelExpereince);
                fillSprite.Draw(spriteBatch, ExperienceBarDrawX, DrawY);
            }
            else
            {
                maxSprite.Draw(spriteBatch, ExperienceBarDrawX, DrawY);
            }

            if (flashTimer.Active && flashTimer.CurrentTime.Ticks / FlashPeriod.Ticks % 2 == 0)
            {
                flashSprite.Draw(spriteBatch, ExperienceBarDrawX, DrawY);
            }
        }
Esempio n. 7
0
 public void DamageExperience(GunExperienceUnit experience)
 {
     currentExperience = Math.Max(0, currentExperience - experience);
 }
Esempio n. 8
0
 public void CollectExpereince(GunExperienceUnit experience)
 {
     currentExperience += experience;
     currentExperience  = Math.Min(Experiences[Units.MaxGunLevel], currentExperience);
 }