public void EndGame(bool activateHighScore) { TheForm.IsPaused = true; Enemies = new List <Enemy>(); gameLevel = new GameLevel(); if (activateHighScore) { TheForm.MenuForm.frmScore.Show(); TheForm.MenuForm.Tema.addTheme(TheForm.MenuForm.frmScore); TheForm.Hide(); if (TheForm.MenuForm.frmScore.checkIfHighscore(TheForm.CurrentScore)) { FormAddScore frmAddScore = new FormAddScore(); DialogResult result = frmAddScore.ShowDialog(); if (result == DialogResult.OK) { string x = frmAddScore.playerName; if (x.Length == 0) { x = "NoName"; } ScoreItem sc = new ScoreItem(x, TheForm.CurrentScore); TheForm.MenuForm.frmScore.addScore(sc); } } else { MessageBox.Show("You did not make it in the first 5 :("); } } else { TheForm.Hide(); TheForm.MenuForm.Show(); } }