# Level Two

## How does it happen?

After the player defeats the Boss KoolAid, they are teleported to level two, which is an arena where you must fight multiple Fleas, the bassist from hit dad rock band The Red Hot Chili Peppers.&#x20;

The if statement below is a case within both attack buttons in FrmBattle, which checks if the player killed the boss. When they do they are sent to Level 2, the battle screen closes as it does normally, and then Level 1 is hidden and has its objects suspended to prevent any bugs.

```csharp
if (enemy.Health <= 0 && enemy.Name == "enemyBossKoolAid") {
    player.Score += 10;
    NextLevel();
}

private void NextLevel() {
    FrmLevel2 level2 = new FrmLevel2();
    //exits application when level2 form closes
    level2.FormClosed += GameExit; 
    //passes player picture
    level2.picPlayer.BackgroundImage = picPlayer.BackgroundImage; 
    level2.Show();

    // pauses everything on level1, since it is still running in the background
    level.HaltAll();
    level.Hide();
}

private void GameExit(object sender, FormClosedEventArgs e) {
    Application.Exit();
}
```

Here in Level 1, the HaltAll() function stops the currently playing music, nulls out all enemy objects and walls, and stops moving the player.

```csharp
internal void HaltAll() {
    StopAndDispose();
    HaltMove = true;
    bossKoolaid = null;
    enemyPoisonPacket = null;
    enemyCheeto = null;
    enemyFlea = null;
    fleaFlag = false;

    walls = null;
}
```
