public void EndGame() { if (GameOver) { return; } GameData.UpdateScore(GameData.GameMode.Arithmetic, Score); ArithmeticModeEndScreen = new GameOverScreen("Arithmetic Mode [High Score: " + GameData.GetScore(GameData.GameMode.Arithmetic) + "]", Score.ToString()); RestartButton = new ButtonTile(new Point(0, 486), "Restart", Color.Black, Color.White, new Size(280, 243)); MenuButton = new ButtonTile(new Point(280, 486), "Menu", Color.Black, Color.White, new Size(280, 243)); GameOver = true; }
public void EndGame(bool Win) { if (GameOver) { return; } int Score = (int)TheStopWatch.ElapsedMilliseconds; if (Win) { GameData.UpdateScore(GameData.GameMode.Speed, Score); } SpeedModeEndScreen = new GameOverScreen("Speed Mode [High Score: " + (GameData.GetScore(GameData.GameMode.Speed) / 1000.0d).ToString() + "s]", (Score / 1000.0d).ToString() + " Seconds" + (Win ? " [WIN]" : " [FAIL]")); RestartButton = new ButtonTile(new Point(0, 486), "Restart", Color.Black, Color.White, new Size(280, 243)); MenuButton = new ButtonTile(new Point(280, 486), "Menu", Color.Black, Color.White, new Size(280, 243)); GameOver = true; }