예제 #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);
            }
        }
예제 #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);
 }
예제 #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);
 }
예제 #4
0
 public void DamageExperience(GunExperienceUnit experience)
 {
     currentExperience = Math.Max(0, currentExperience - experience);
 }
예제 #5
0
 public void CollectExpereince(GunExperienceUnit experience)
 {
     currentExperience += experience;
     currentExperience = Math.Min(Experiences[Units.MaxGunLevel], currentExperience);
 }
예제 #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);
            }
        }
예제 #7
0
 public void DamageExperience(GunExperienceUnit experience)
 {
     currentExperience = Math.Max(0, currentExperience - experience);
 }
예제 #8
0
 public void CollectExpereince(GunExperienceUnit experience)
 {
     currentExperience += experience;
     currentExperience  = Math.Min(Experiences[Units.MaxGunLevel], currentExperience);
 }