public SearchLocalNetworkScreen(PlayerIndex playerIndex, AvailableNetworkSessionCollection availableSessions)
            : base("Local Network Game Search")
        {
            currentPlayer = playerIndex;
            IsPopupWindow = true;
            this.availableSessions = availableSessions;
            if (availableSessions.Count == 0)
            {
                Games = new MenuEntry("No Games found");
                returnEntry = new MenuEntry("Return");
                MenuEntries.Add(Games);
            }
            else
            {
                gameCount = 0;
                totalGames = availableSessions.Count;
                currentSessionSelected = availableSessions[0];
                Games = new MenuEntry("Game: 0 / " + gameCount);
                gameMode = new MenuEntry("Game mode: " + GameType());
                highScore = new MenuEntry("Hi score: " + WinningScore());
                joinGame = new MenuEntry("Join this game");

                joinGame.Selected += JoinSession;
                MenuEntries.Add(Games);
                MenuEntries.Add(gameMode);
                MenuEntries.Add(highScore);
                MenuEntries.Add(joinGame);

            }

            // hook up event handlers
            returnEntry.Selected += GoBack;

            MenuEntries.Add(returnEntry);
        }
예제 #2
0
        public NetworkGameMenu(PlayerIndex enteringPlayer)
            : base("Start a network game")
        {
            currentPlayerIndex = enteringPlayer;
            currentGamer = SignedInGamer.SignedInGamers[currentPlayerIndex];
            // Create our menu entries.
            if (currentGamer != null)
            {
                opt1 = new MenuEntry("Currently signed in");
            }
            else
            {
                opt1 = new MenuEntry("Select to sign in");
                SignedInGamer.SignedIn += new EventHandler<SignedInEventArgs>(gamerSignIn);
            }
            MenuEntry opt2 = new MenuEntry("Host local network game");
            MenuEntry opt3 = new MenuEntry("Join local newtwork game");
            MenuEntry opt4 = new MenuEntry("Go Back");

            opt1.Selected += LiveSignIn;
            opt2.Selected += HostLocalGame;
            opt3.Selected += FindLocalGame;
            opt4.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(opt1);
            MenuEntries.Add(opt2);
            MenuEntries.Add(opt3);
            MenuEntries.Add(opt4);
            SetMenuEntryText();
        }
        public LocalNetworkGameMenu(PlayerIndex enteringPlayer, NetworkSession nSession)
            : base("Local Network Game Lobby")
        {
            netSession = nSession;
            currentPlayerIndex = enteringPlayer;
            currentGamer = SignedInGamer.SignedInGamers[currentPlayerIndex];
            netSession.GameStarted += new EventHandler<GameStartedEventArgs>(loadNetworkGameScreen);

            // Create our menu entries.
            gameTypeOption = new MenuEntry("Game Type: " + GameType());
            highScoreOption = new MenuEntry("Score to Win: " + WinningScore());
            opt2 = new MenuEntry("Host: " + nSession.Host.ToString());
            opt3 = new MenuEntry("Ready?");
            opt4 = new MenuEntry("Waiting for opponent");
            opt5 = new MenuEntry("Go Back");

            netSession.GameStarted += new EventHandler<GameStartedEventArgs>(StartGame);

            gameTypeOption.Selected += changeGameType;
            highScoreOption.Selected += changeWinningScore;
            opt3.Selected += setReady;
            opt4.Selected += startGame;
            opt5.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(gameTypeOption);
            MenuEntries.Add(highScoreOption);
            MenuEntries.Add(opt2);
            MenuEntries.Add(opt3);
            MenuEntries.Add(opt4);
            MenuEntries.Add(opt5);

            SetMenuEntryText();
        }
예제 #4
0
        public PauseMenuScreen(GameScreen callingScreen)
            : base("No More Meatballs?")
        {
            screen = callingScreen;
            IsPopupWindow = true;
            ready = false;
            isNetworkGame = false;
            resumeGameMenuEntry = new MenuEntry("Keep Eating");
            quitGameMenuEntry = new MenuEntry("I'll take this to go");

            // hook up event handlers
            resumeGameMenuEntry.Selected += UnpauseGame;
            quitGameMenuEntry.Selected += QuitGameSelected;

            MenuEntries.Add(resumeGameMenuEntry);
            MenuEntries.Add(quitGameMenuEntry);
        }
예제 #5
0
        public OptionsScreen()
            : base("Game Options")
        {
            // Create our menu entries.
            opt1 = new MenuEntry(string.Empty);
            opt2 = new MenuEntry(string.Empty);
            opt3 = new MenuEntry("Go Back");

            opt1.Selected += SoundMenuEntrySelected;
            opt2.Selected += DifficultyMenuEntrySelected;
            opt3.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(opt1);
            MenuEntries.Add(opt2);
            MenuEntries.Add(opt3);

            SetMenuEntryText();
        }
예제 #6
0
        public CreditsScreen()
            : base("Credits")
        {
            // Create our menu entries.
            createdBy = new MenuEntry("This meaty game was created by:");
            nick = new MenuEntry("Nick Choumitsky - did all the work");
            lauren = new MenuEntry("Lauren Domingo - drew everything");
            dan = new MenuEntry("Dan Aronds - Our lead.rar");
            specialThanks = new MenuEntry("Special thanks to:");
            tom = new MenuEntry("Tom Gehr - the inspiration for Meatieroids");
            exit = new MenuEntry("Go Back");

            exit.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(createdBy);
            MenuEntries.Add(nick);
            MenuEntries.Add(lauren);
            MenuEntries.Add(dan);
            MenuEntries.Add(specialThanks);
            MenuEntries.Add(tom);
            MenuEntries.Add(exit);
        }
예제 #7
0
        public MainMenuScreen()
            : base("Main Menu")
        {
            // Create our menu entries.
            MenuEntry playGameMenuEntry = new MenuEntry("Play Local Game");
            MenuEntry playNetworkGame = new MenuEntry("Play Network Game");
            MenuEntry optionMenuEntry = new MenuEntry("Options");
            MenuEntry creditsEntry = new MenuEntry("Credits");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            // Hook up menu event handlers.
            playGameMenuEntry.Selected += PlayGameSelected;
            playNetworkGame.Selected += OnNetworkGameSelected;
            optionMenuEntry.Selected += OnOptionsSelected;
            creditsEntry.Selected += OnCreditsSelected;
            exitMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(playNetworkGame);
            MenuEntries.Add(optionMenuEntry);
            MenuEntries.Add(creditsEntry);
            MenuEntries.Add(exitMenuEntry);
        }