void TonLoadContentMiniBoss() { MiniBoss mb = new MiniBoss(2, "firebolt2"); mb.LoadContent(Content); miniBoss.Add(mb); createMiniBoss = miniBoss[0].miniBoss; healthBarMiniBoss = miniBoss[0].healthBarMiniBoss; }
void LabelLevelAndReset(GameTime gameTime) { // Level 1 // ---------------------------------------------------------------------- elapsedTimeShowLevelLabel1 += (float)gameTime.ElapsedGameTime.TotalSeconds; if (elapsedTimeShowLevelLabel1 <= 3.0f) { zombie.LevelShowMessage(Content, spriteBatch, player1, 1); } // Level 1 // ---------------------------------------------------------------------- // Level 2 // ---------------------------------------------------------------------- if (zombie.readyChange && currentLevel == 1) { elapsedTimeShowLevelLabel2 += (float)gameTime.ElapsedGameTime.TotalSeconds; if (elapsedTimeShowLevelLabel2 <= 3.0f) { for (int i = zombie.zombie.Count - 1; i >= 0; i--) { zombie.zombie.RemoveAt(i); } for (int i = medicine.Count - 1; i >= 0; i--) { medicine.RemoveAt(i); } for (int i = shotgun.Count - 1; i >= 0; i--) { shotgun.RemoveAt(i); } for (int i = grenade.Count - 1; i >= 0; i--) { grenade.RemoveAt(i); } if (player1.Active == true) { player1.position.X = 960; player1.position.Y = 760; } if (player2.Active == true) { player2.position.X = 960 + 40; player2.position.Y = 760; } zombie.LevelShowMessage(Content, spriteBatch, player1, 2); if (elapsedTimeShowLevelLabel2 > 2.9f) { sound.levelUpSound.Play(); zombie.readyChange = false; collision.ZombieDieCount = 0; elapsedTimeShowLevelLabel2 = 0; zombie.Level2Active = true; currentLevel = 2; } } } // Level 2 // ---------------------------------------------------------------------- // Level 3 // ---------------------------------------------------------------------- if (zombie.Level2Active == true && currentLevel == 2 && zombie.readyChange == true) { //zombie.Level2Active = false; elapsedTimeShowLevelLabel3 += (float)gameTime.ElapsedGameTime.TotalSeconds; if (elapsedTimeShowLevelLabel3 <= 3.0f) { for (int i = zombie.zombie.Count - 1; i >= 0; i--) { zombie.zombie.RemoveAt(i); } for (int i = medicine.Count - 1; i >= 0; i--) { medicine.RemoveAt(i); } for (int i = shotgun.Count - 1; i >= 0; i--) { shotgun.RemoveAt(i); } for (int i = grenade.Count - 1; i >= 0; i--) { grenade.RemoveAt(i); } if (player1.Active == true) { player1.position.X = 960; player1.position.Y = 760; } if (player2.Active == true) { player2.position.X = 960 + 40; player2.position.Y = 760; } zombie.LevelShowMessage(Content, spriteBatch, player1, 3); if (elapsedTimeShowLevelLabel3 > 2.9f) { sound.levelUpSound.Play(); zombie.readyChange = false; collision.ZombieDieCount = 0; elapsedTimeShowLevelLabel3 = 0; zombie.Level3Active = true; currentLevel = 3; } } } // Level 3 // ---------------------------------------------------------------------- // Level 4 // ---------------------------------------------------------------------- if (zombie.Level3Active == true && currentLevel == 3 && zombie.readyChange == true && collision.MiniBossDieCount == 2) { for (int i = zombie.zombie.Count - 1; i >= 0; i--) { zombie.zombie.RemoveAt(i); } for (int i = medicine.Count - 1; i >= 0; i--) { medicine.RemoveAt(i); } for (int i = shotgun.Count - 1; i >= 0; i--) { shotgun.RemoveAt(i); } for (int i = grenade.Count - 1; i >= 0; i--) { grenade.RemoveAt(i); } if (player1.Active == true) { player1.position.X = 960; player1.position.Y = 760; } if (player2.Active == true) { player2.position.X = 960 + 40; player2.position.Y = 760; } elapsedTimeShowLevelLabel4 += (float)gameTime.ElapsedGameTime.TotalSeconds; if (elapsedTimeShowLevelLabel4 <= 3.0f) { miniBoss.RemoveAt(0); MiniBoss mb = new MiniBoss(3, "firebolt2"); mb.LoadContent(Content); miniBoss.Add(mb); createMiniBoss = miniBoss[0].miniBoss; healthBarMiniBoss = miniBoss[0].healthBarMiniBoss; zombie.LevelShowMessage(Content, spriteBatch, player1, 4); if (elapsedTimeShowLevelLabel4 > 2.9f) { sound.levelUpSound.Play(); zombie.readyChange = false; collision.ZombieDieCount = 0; elapsedTimeShowLevelLabel4 = 0; zombie.Level4Active = true; collision.MiniBossDieCount = 0; currentLevel = 4; } } } // Level 4 // ---------------------------------------------------------------------- // Level 5 // ---------------------------------------------------------------------- if (zombie.Level4Active == true && currentLevel == 4 && zombie.readyChange == true && collision.MiniBossDieCount == 3) { for (int i = zombie.zombie.Count - 1; i >= 0; i--) { zombie.zombie.RemoveAt(i); } for (int i = medicine.Count - 1; i >= 0; i--) { medicine.RemoveAt(i); } for (int i = shotgun.Count - 1; i >= 0; i--) { shotgun.RemoveAt(i); } for (int i = grenade.Count - 1; i >= 0; i--) { grenade.RemoveAt(i); } if (player1.Active == true) { player1.position.X = 960; player1.position.Y = 760; } if (player2.Active == true) { player2.position.X = 960 + 40; player2.position.Y = 760; } elapsedTimeShowLevelLabel5 += (float)gameTime.ElapsedGameTime.TotalSeconds; if (elapsedTimeShowLevelLabel5 <= 3.0f) { miniBoss.RemoveAt(0); MiniBoss mb = new MiniBoss(2, "firebolt2"); mb.LoadContent(Content); miniBoss.Add(mb); createMiniBoss = miniBoss[0].miniBoss; healthBarMiniBoss = miniBoss[0].healthBarMiniBoss; zombie.LevelShowMessage(Content, spriteBatch, player1, 5); if (elapsedTimeShowLevelLabel5 > 2.9f) { sound.levelUpSound.Play(); zombie.readyChange = false; collision.ZombieDieCount = 0; elapsedTimeShowLevelLabel5 = 0; zombie.Level5Active = true; collision.MiniBossDieCount = 0; currentLevel = 5; } } } // Level 5 // ---------------------------------------------------------------------- if (currentLevel == 5 && zombie.readyChange == true) { Winner = true; } }