Exemple #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public PauseMenuScreen()
            : base("Paused")
        {
            // Create our menu entries
            MenuEntry resumeGameMenuEntry = new MenuEntry("Resume");
            MenuEntry quitGameMenuEntry = new MenuEntry("Quit");

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

            // Add entries to menu
            MenuEntries.Add(resumeGameMenuEntry);
            MenuEntries.Add(quitGameMenuEntry);
        }
Exemple #2
0
        public MainMenuScreen()
            : base("Main Menu")
        {
            // Create the menu entries
            MenuEntry playEntry = new MenuEntry("Play");
            MenuEntry highScoresEntry = new MenuEntry("High Scores");
            MenuEntry creditsEntry = new MenuEntry("Credits");
            MenuEntry exitEntry = new MenuEntry("Exit");

            // Hook up menu event handlers
            playEntry.Selected       += PlayEntrySelected;
            highScoresEntry.Selected += HighScoresEntrySelected;
            creditsEntry.Selected    += CreditsEntrySelected;
            exitEntry.Selected       += OnCancel;

            // Add entries to the menu
            MenuEntries.Add(playEntry);
            MenuEntries.Add(highScoresEntry);
            MenuEntries.Add(creditsEntry);
            MenuEntries.Add(exitEntry);
        }
Exemple #3
0
        public GameMenuScreen()
            : base("Maze Size")
        {
            // Create the menu entries
            MenuEntry fiveEntry    = new MenuEntry("5x5");
            MenuEntry tenEntry     = new MenuEntry("10x10");
            MenuEntry fifteenEntry = new MenuEntry("15x15");
            MenuEntry twentyEntry  = new MenuEntry("20x20");

            // Hook up event handlers
            fiveEntry.Selected    += fiveEntrySelected;
            tenEntry.Selected     += tenEntrySelected;
            fifteenEntry.Selected += fifteenEntrySelected;
            twentyEntry.Selected  += twentyEntrySelected;

            // Add entries to the menu
            MenuEntries.Add(fiveEntry);
            MenuEntries.Add(tenEntry);
            MenuEntries.Add(fifteenEntry);
            MenuEntries.Add(twentyEntry);
        }