public override void InitializeStageBoss() { //SPAWN BOSS, THINK IS GOOD boss = new FirstBossSprite(game, game.Content.Load<Texture2D>(@"Images/FirstBossSprite"), new Vector2(game.Window.ClientBounds.Width / 2 - 100, -30), new Point(200, 200), 5, new Point(0, 0), new Point(3, 1), new Vector2(2, 2), true, 150,//If this is changed, change the value in InGameScreen => Draw boss life. 150); }
public virtual void GameStageHandler() { //Handles the different stages in a level. switch (stage) { case CurrentLevelStage.enemyStage1: if (!stage1Initialized) { InitializeStage1(); stage1Initialized = true; } if (enemyList.Count == 0) { stage = CurrentLevelStage.enemyStage2; } break; case CurrentLevelStage.enemyStage2: if (!stage2Initialized) { InitializeStage2(); stage2Initialized = true; } if (enemyList.Count == 0) { stage = CurrentLevelStage.enemyStage3; } break; case CurrentLevelStage.enemyStage3: if (!stage3Initialized) { InitializeStage3(); stage3Initialized = true; } if (enemyList.Count == 0) { stage = CurrentLevelStage.bossStage; } break; case CurrentLevelStage.bossStage: //Spawn the boss if there is none if (boss == null && stage != CurrentLevelStage.playerWonStage && !bossStageInitialized) { InitializeStageBoss(); bossStageInitialized = true; if (InGameScreen.level == CurrentLevel.level1) { InGameScreen.maxBossLife = boss.Life; //Needed to draw the life bar correctly } else InGameScreen.maxBossLife = secondBoss.Life; //Needed to draw the life bar correctly } //The boss is dead, give score, remove him and show a win screen. if (boss != null && !boss.alive) { //Gives score for the boss kill. Sounds.SoundBank.PlayCue("BossDeath"); stage = CurrentLevelStage.playerWonStage; InGameScreen.playerScore += boss.scoreAmount * InGameScreen.scoreMultiplier * (int)InGameScreen.difficulty; boss = null; bullets.Clear(); Thread.Sleep(1000); } else if (secondBoss != null && !secondBoss.alive) { //Gives score for the boss kill. Sounds.SoundBank.PlayCue("BossDeath"); stage = CurrentLevelStage.playerWonStage; InGameScreen.playerScore += secondBoss.scoreAmount * InGameScreen.scoreMultiplier * (int)InGameScreen.difficulty; secondBoss = null; bullets.Clear(); Thread.Sleep(1000); } break; case CurrentLevelStage.playerWonStage: if (!saved) { HighScores.SaveHighscoreToFile(); saved = true; if (InGameScreen.level == CurrentLevel.level1) { LevelWon(); } else WinScreen(); InGameScreen.level += 1; } break; default: break; } }