Ejemplo n.º 1
0
 void quitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     const string message = "Are you sure you want to quit?";
     MessageBoxScreen confirmQuitMessageBox = new MessageBoxScreen(message);
     confirmQuitMessageBox.Accepted += confirmQuitMessageBoxAccepted;
     ScreenManager.AddScreen(confirmQuitMessageBox, ControllingPlayer);
 }
Ejemplo n.º 2
0
 //event handlers:
 void restartGameMenuSelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new GameplayScreen(p1name, p2name,
         mapName, p1ai, p2ai, p1aiLevel, p2aiLevel));
 }
Ejemplo n.º 3
0
 void restartDifferentGameMenuSelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new PlayGameScreen());
 }
Ejemplo n.º 4
0
 void confirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
 }
Ejemplo n.º 5
0
 void p2HumanOrAISelected(object sender, PlayerIndexEventArgs e)
 {
     currentP2HumanOrAi = (currentP2HumanOrAi + 1) % humanOrAI.Length;
     updateMenuEntries();
 }
Ejemplo n.º 6
0
        void playGameSelected(object sender, PlayerIndexEventArgs e)
        {
            bool player1IsAI;
            bool player2IsAI;
            string player1Name;
            string player2Name;

            if (currentP1HumanOrAi == 0)
                {
                player1IsAI = false;
                player1Name = "Player 1";
                }
            else
                {
                player1IsAI = true;
                player1Name = "Computer 1";
                }

            if (currentP2HumanOrAi == 0)
                {
                player2IsAI = false;
                player2Name = "Player 2";
                }
            else
                {
                player2IsAI = true;
                player2Name = "Computer 2";
                }

            string map = "map" + (currentMap + 1) + ".txt";

            LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new GameplayScreen(player1Name, player2Name,
                map, player1IsAI, player2IsAI, currentP1HumanOrAi, currentP2HumanOrAi));
        }
Ejemplo n.º 7
0
 void confirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new MainMenuScreen(), e.PlayerIndex);
 }
Ejemplo n.º 8
0
 void mapSelected(object sender, PlayerIndexEventArgs e)
 {
     currentMap = (currentMap + 1) % maps.Keys.Count;
     updateMenuEntries();
 }
Ejemplo n.º 9
0
 protected void OnCancel(object sender, PlayerIndexEventArgs e)
 {
     OnCancel(e.PlayerIndex);
 }
Ejemplo n.º 10
0
 void helpMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new HelpMenuScreen(), e.PlayerIndex);
 }
Ejemplo n.º 11
0
 void confirmExitMessageBoxAccepted(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.Game.Exit();
 }
Ejemplo n.º 12
0
 void soundOnOrOffSelected(object sender, PlayerIndexEventArgs e)
 {
     soundsOn = !soundsOn;
     updateMenuEntries();
 }
Ejemplo n.º 13
0
 //event handlers:
 void playGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new PlayGameScreen(), e.PlayerIndex);
 }