Beispiel #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public OptionsMenuScreen()
            : base("Options")
        {
            // Create our menu entries.
            ungulateMenuEntry = new MenuEntry(string.Empty);
            languageMenuEntry = new MenuEntry(string.Empty);
            frobnicateMenuEntry = new MenuEntry(string.Empty);
            elfMenuEntry = new MenuEntry(string.Empty);

            SetMenuEntryText();

            MenuEntry back = new MenuEntry("Back");

            // Hook up menu event handlers.
            ungulateMenuEntry.Selected += UngulateMenuEntrySelected;
            languageMenuEntry.Selected += LanguageMenuEntrySelected;
            frobnicateMenuEntry.Selected += FrobnicateMenuEntrySelected;
            elfMenuEntry.Selected += ElfMenuEntrySelected;
            back.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(ungulateMenuEntry);
            MenuEntries.Add(languageMenuEntry);
            MenuEntries.Add(frobnicateMenuEntry);
            MenuEntries.Add(elfMenuEntry);
            MenuEntries.Add(back);
        }
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen()
            : base("")
        {
            // Create our menu entries.
            MenuEntry playGameMenuEntry = new MenuEntry("Play Game");
            MenuEntry instructionsEntry = new MenuEntry("Instructions");
            MenuEntry controlsMenuEntry = new MenuEntry("Controls");
            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry creditsEntry = new MenuEntry("Credits");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            // Hook up menu event handlers.
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
            instructionsEntry.Selected += InstructionsMenuEntrySelected;
            controlsMenuEntry.Selected += ControlsMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            creditsEntry.Selected += CreditsEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(instructionsEntry);
            MenuEntries.Add(controlsMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(creditsEntry);
            MenuEntries.Add(exitMenuEntry);
        }
Beispiel #3
0
 public PauseMenuScreen()
     : base("Paused")
 {
     MenuEntry resumeGameMenuEntry = new MenuEntry("Resume Game");
     MenuEntry quitGameMenuEntry = new MenuEntry("Quit Game");
     resumeGameMenuEntry.Selected += OnCancel;
     quitGameMenuEntry.Selected += QuitGameMenuEntrySelected;
     MenuEntries.Add(resumeGameMenuEntry);
     MenuEntries.Add(quitGameMenuEntry);
 }
Beispiel #4
0
        public GameOverScreen()
            : base("Game Over")
        {
            MenuEntry playGameMenuEntry = new MenuEntry("Play Game");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            exitMenuEntry.Selected += OnCancel;
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;

            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(exitMenuEntry);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public CreditsScreen()
            : base("Credits")
        {
            // Create our menu entries.
            MenuEntry back = new MenuEntry("Back");

            // Hook up menu event handlers.
            back.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(back);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public PauseMenuScreen()
            : base("Paused")
        {
            // Create our menu entries.
            MenuEntry resumeGameMenuEntry = new MenuEntry("Resume Game");
            MenuEntry quitGameMenuEntry = new MenuEntry("Quit Game");

            // Hook up menu event handlers.
            resumeGameMenuEntry.Selected += OnCancel;
            quitGameMenuEntry.Selected += QuitGameMenuEntrySelected;

            // Add entries to the menu.
            MenuEntries.Add(resumeGameMenuEntry);
            MenuEntries.Add(quitGameMenuEntry);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public MultiplayerMenuScreen()
            : base("Multiplayer")
        {
            // Create our menu entries.
            joinSessionMenuEntry = new MenuEntry("Join Session");
            backMenuEntry = new MenuEntry("Back");

            // Hook up menu event handlers.
            joinSessionMenuEntry.Selected += JoinSessionMenuSelected;
            backMenuEntry.Selected += BackMenuSelected;

            // Add entries to the menu.
            MenuEntries.Add(joinSessionMenuEntry);
            MenuEntries.Add(backMenuEntry);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public GameOverScreen()
            : base("Game Over")
        {
            // Create our menu entries.
            tryAgainMenuEntry = new MenuEntry("Retry");
            quitGameMenuEntry = new MenuEntry("Quit Game");

            // Hook up menu event handlers.
            tryAgainMenuEntry.Selected += tryAgainMenuEntrySelected;
            quitGameMenuEntry.Selected += QuitGameMenuEntrySelected;

            // Add entries to the menu.
            MenuEntries.Add(tryAgainMenuEntry);
            MenuEntries.Add(quitGameMenuEntry);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public WinLoseScreen(GameplayScreen screen, bool allPlayersDead, bool allEnemiesDead)
            : base("")
        {
            removeScreenGameplay = screen;
            playersDead = allPlayersDead;
            enemiesDead = allEnemiesDead;

            MenuEntry restartGameMenuEntry = new MenuEntry("Restart Game");
            MenuEntry quitGameMenuEntry = new MenuEntry("Quit Game");

            // Hook up menu event handlers.
            restartGameMenuEntry.Selected += RestartGameMenuEntrySelected;
            quitGameMenuEntry.Selected += QuitGameMenuEntrySelected;

            // Add entries to the menu.
            MenuEntries.Add(restartGameMenuEntry);
            MenuEntries.Add(quitGameMenuEntry);
        }
Beispiel #10
0
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen()
            : base("Main Menu")
        {
            // Create our menu entries.
            MenuEntry playGameMenuEntry = new MenuEntry("Play Game");
            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            // Hook up menu event handlers.
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(exitMenuEntry);
        }
Beispiel #11
0
        /// <summary>
        /// Remplissage du menu
        /// </summary>
        public MainMenuScreen()
            : base("Menu Principal")
        {
            // Création des entrées de menu
            MenuEntry playGameMenuEntry = new MenuEntry("Jouer");
            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry exitMenuEntry = new MenuEntry("Quitter");

            // Ajout des pointeurs de fonction qui seront effectuées lors de la sélection d'une entrée de menu (validation)
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            // Ajout des entrées de menu au menu
            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(exitMenuEntry);
        }
Beispiel #12
0
        public PlayerWonScreen(TimeSpan time)
            : base("")
        {
            MenuEntry playGameMenuEntry = new MenuEntry("Play Game");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            exitMenuEntry.Selected += OnCancel;
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;

            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(exitMenuEntry);

            FileInfo highscoreFile = new FileInfo("Highscore.txt");
            using (Stream filestream = highscoreFile.Open(FileMode.Append, FileAccess.Write))
            using (StreamWriter write = new StreamWriter(filestream))
            {
                write.WriteLine("{0};{1:c}", Managers.PlayerName, time);
            }
        }
Beispiel #13
0
        public OptionsMenuScreen()
            : base("Options")
        {
            //ungulateMenuEntry = new MenuEntry(string.Empty);
            //languageMenuEntry = new MenuEntry(string.Empty);
            MovementMenuEntry = new MenuEntry(string.Empty);

            //elfMenuEntry = new MenuEntry(string.Empty);
            SetMenuEntryText();
            MenuEntry back = new MenuEntry("Back");
            //ungulateMenuEntry.Selected += UngulateMenuEntrySelected;
            //languageMenuEntry.Selected += LanguageMenuEntrySelected;
            MovementMenuEntry.Selected += MovementMenuEntrySelected;
            //elfMenuEntry.Selected += ElfMenuEntrySelected;
            back.Selected += OnCancel;
            //MenuEntries.Add(ungulateMenuEntry);
            //MenuEntries.Add(languageMenuEntry);
            MenuEntries.Add(MovementMenuEntry);
            //MenuEntries.Add(elfMenuEntry);
            MenuEntries.Add(back);
        }
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen()
            : base("Main Menu")
        {
            // Create our menu entries.
            MenuEntry playGameMenuEntry = new MenuEntry("Play");
            MenuEntry multiplayerMenuEntry = new MenuEntry("Multiplayer");
            MenuEntry howtoplayMenuEntry = new MenuEntry("How To Play");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            // Hook up menu event handlers.
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
            multiplayerMenuEntry.Selected += MultiplayerMenuEntrySelected;
            howtoplayMenuEntry.Selected += HowtoplayMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(multiplayerMenuEntry);
            MenuEntries.Add(howtoplayMenuEntry);
            MenuEntries.Add(exitMenuEntry);
        }
Beispiel #15
0
        public HighscoreMenuScreen()
            : base("Highscore")
        {
            List<Highscore> highscores = new List<Highscore>();
            FileInfo highscoreFile = new FileInfo("Highscore.txt");
            using (Stream filestream = highscoreFile.Open(FileMode.OpenOrCreate, FileAccess.Read))
            using (StreamReader reader = new StreamReader(filestream))
            {
                while (!reader.EndOfStream)
                {
                    string line = reader.ReadLine();

                    if (string.IsNullOrWhiteSpace(line)) continue;

                    string[] temp = line.Split(';');

                    string name = temp[0];
                    TimeSpan time = TimeSpan.Parse(temp[1]);

                    highscores.Add(Tuple.Create(name, time));
                }
            }

            highscores.Sort(sortTuple);

            int count = Math.Min(10, highscores.Count);

            for (int i = 0; i < count; i++)
            {
                string name = highscores[i].Item1;
                TimeSpan time = highscores[i].Item2;
                MenuEntries.Add(new MenuEntry(string.Format("{0}: {1:g}", name, time)));
            }

            MenuEntry back = new MenuEntry("Back");

            back.Selected += OnCancel;

            MenuEntries.Add(back);
        }
Beispiel #16
0
        public MainMenuScreen()
            : base("")
        {
            name = new TextMenuEntry("Name", Managers.PlayerName);
            MenuEntry playGameMenuEntry = new MenuEntry("Play Game");
            MenuEntry highscoreMenuEntry = new MenuEntry("Highscore");
            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            MenuEntries.Add(name);
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;

            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            highscoreMenuEntry.Selected += HighscoreMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(highscoreMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(exitMenuEntry);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public OptionsMenuScreen()
            : base("Options")
        {
            // Create our menu entries.
            //ungulateMenuEntry = new MenuEntry(string.Empty);
            //languageMenuEntry = new MenuEntry(string.Empty);
            //frobnicateMenuEntry = new MenuEntry(string.Empty);
            //elfMenuEntry = new MenuEntry(string.Empty);

            splitScreenMenuEntry = new MenuEntry(string.Empty);
            bgmMenuEntry = new MenuEntry(string.Empty);
            sfxMenuEntry = new MenuEntry(string.Empty);

            SetMenuEntryText();

            MenuEntry back = new MenuEntry("Back");

            // Hook up menu event handlers.
            //ungulateMenuEntry.Selected += UngulateMenuEntrySelected;
            //languageMenuEntry.Selected += LanguageMenuEntrySelected;
            //frobnicateMenuEntry.Selected += FrobnicateMenuEntrySelected;
            //elfMenuEntry.Selected += ElfMenuEntrySelected;
            splitScreenMenuEntry.Selected += SplitScreenMenuEntrySelected;
            bgmMenuEntry.Selected += BgmMenuEntrySelected;
            sfxMenuEntry.Selected += SfxMenuEntrySelected;
            back.Selected += OnCancel;

            // Add entries to the menu.
            //MenuEntries.Add(ungulateMenuEntry);
            //MenuEntries.Add(languageMenuEntry);
            //MenuEntries.Add(frobnicateMenuEntry);
            //MenuEntries.Add(elfMenuEntry);
            MenuEntries.Add(splitScreenMenuEntry);
            MenuEntries.Add(bgmMenuEntry);
            MenuEntries.Add(sfxMenuEntry);
            MenuEntries.Add(back);
        }