Ejemplo n.º 1
0
        public GameEndedScreen(int score, int level, string menuTitle)
            : base("Game Over")
        {
            GameController.HighScores = HighScoreController.ReadAllHighScores();
            var h = new HighScore()
                {
                    Difficulty = "Easy",
                    Level = level,
                    Score = score,
                    Name = "random"
                };
            GameController.HighScores.Add(h);
            GameController.HighScores = GameController.HighScores.OrderByDescending(x => x.Score).Take(10).ToList();

            if (GameController.HighScores.Contains(h))
            {
                var newScore = new MenuEntry("Congratulation, new High Score");

                var scor = new MenuEntry("Score: " + h.Score + ", Level: " + h.Level);

                newScore.Selected += HighScoreMenuSelected;
                scor.Selected += HighScoreMenuSelected;

                newScore.Selected += OnCancel;
                scor.Selected += OnCancel;

                MenuEntries.Add(newScore);
                MenuEntries.Add(scor);

                HighScoreController.SaveHighScores();
            }
            else
            {
                var damn = new MenuEntry("Game Over - no luck for you");
                damn.Selected += HighScoreMenuSelected;
                damn.Selected += OnCancel;

                MenuEntries.Add(damn);
            }
        }
Ejemplo n.º 2
0
 internal static void AddHigh(HighScore high)
 {
     HighScores.Add(high);
 }