Example #1
0
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen()
        {
            MenuEntry playGameMenuEntry = new MenuEntry("Play Game");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");
            playGameMenuEntry.Color = Color.Red;
            playGameMenuEntry.Selected += playGameMenuEntrySelected;
            exitMenuEntry.Color = Color.Red;
            exitMenuEntry.Selected += ExitMenuEntrySelected;

            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(exitMenuEntry);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public PauseMenuScreen()
        {
            MenuEntry resumeGameMenuEntry = new MenuEntry("Resume Game");
            MenuEntry quitGameEntry = new MenuEntry("Quit Game");
            //Override the color of the text
            resumeGameMenuEntry.Color = Color.White;
            quitGameEntry.Color = Color.White;

            //Set the event handlers
            resumeGameMenuEntry.Selected += ResumeGameMenuEntrySelected;
            quitGameEntry.Selected += QuitGameEntrySelected;

            MenuEntries.Add(resumeGameMenuEntry);
            MenuEntries.Add(quitGameEntry);

            // Flag that there is no need for the game to transition
            // off when the pause menu is on top of it.
            IsPopup = true;
        }
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen()
        {
            MenuEntry practiceGameMenuEntry = new MenuEntry("Practice");
            MenuEntry simonSaysGameMenuEntry = new MenuEntry("Simon Says");
            MenuEntry survivalGameMenuEntry = new MenuEntry("Survival");
            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            practiceGameMenuEntry.Selected += PracticeGameMenuEntrySelected;
            simonSaysGameMenuEntry.Selected += SimonSaysGameMenuEntrySelected;
            survivalGameMenuEntry.Selected += SurvivalGameMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            exitMenuEntry.Selected += ExitMenuEntrySelected;

            MenuEntries.Add(practiceGameMenuEntry);
            MenuEntries.Add(simonSaysGameMenuEntry);
            MenuEntries.Add(survivalGameMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(exitMenuEntry);
        }