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); } }
public PolarStar(ContentManager Content) { sprites = new Dictionary<PolarStarSpriteState, Sprite>(); currentExperience = 0; horizontalProjectiles = new Sprite[Units.MaxGunLevel]; verticalProjectiles = new Sprite[Units.MaxGunLevel]; InitializeSprites(Content); }
public PolarStar(ContentManager Content) { sprites = new Dictionary <PolarStarSpriteState, Sprite>(); currentExperience = 0; horizontalProjectiles = new Sprite[Units.MaxGunLevel]; verticalProjectiles = new Sprite[Units.MaxGunLevel]; InitializeSprites(Content); }
public void DamageExperience(GunExperienceUnit experience) { currentExperience = Math.Max(0, currentExperience - experience); }
public void CollectExpereince(GunExperienceUnit experience) { currentExperience += experience; currentExperience = Math.Min(Experiences[Units.MaxGunLevel], currentExperience); }