Ejemplo n.º 1
0
        /// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(ScreenManager screenManager,
            EventHandler<EventArgs> loadNextScreen,
            bool loadingIsSlow)
        {
            // Tell all the current screens to transition off.
            foreach (GameScreen screen in screenManager.GetScreens())
                screen.ExitScreen();

            // Create and activate the loading screen.
            LoadingScreen loadingScreen = new LoadingScreen();

            loadingScreen.loadingIsSlow = loadingIsSlow;
            loadingScreen.loadNextScreen = loadNextScreen;

            screenManager.AddScreen(loadingScreen);
        }
        /// <summary>
        /// Responds to user input, accepting or cancelling the message box.
        /// </summary>
        public override void HandleInput(InputState input)
        {
            if (input.MenuCancel)
            {
                ExitScreen();
            }

            if (input.MenuSelect && World.ShipManager.SelectedPlayers.Any())
            {
                var arenaSelection = new ArenaSelectionScreen
                {
                    ScreenManager = this.ScreenManager
                };
                arenaSelection.Initialize();
                ScreenManager.AddScreen(arenaSelection);
            }

            if (World.ShipManager.SelectedPlayers.Any(p => p.PlayerStringToIndex == PlayerIndex.One))
            {
                if (input.IsNewButtonPress(Buttons.DPadUp) || input.IsNewButtonPress(Buttons.LeftThumbstickUp))
                {
                    ChangePlayerColour(PlayerIndex.One);
                }

                if (input.IsNewButtonPress(Buttons.RightShoulder))
                {
                    ChangePlayerShip(PlayerIndex.One);
                }
            }

            if (World.ShipManager.SelectedPlayers.Any(p => p.PlayerStringToIndex == PlayerIndex.Two))
            {
                if (input.IsNewButtonPress(Buttons.DPadUp) || input.IsNewButtonPress(Buttons.LeftThumbstickUp))
                {
                    ChangePlayerColour(PlayerIndex.Two);
                }

                if (input.IsNewButtonPress(Buttons.RightShoulder))
                {
                    ChangePlayerShip(PlayerIndex.Two);
                }
            }

            if (World.ShipManager.SelectedPlayers.Any(p => p.PlayerStringToIndex == PlayerIndex.Three))
            {
                if (input.IsNewKeyPress(Keys.W))
                {
                    ChangePlayerColour(PlayerIndex.Three);
                }

                if (input.IsNewKeyPress(Keys.Tab))
                {
                    ChangePlayerShip(PlayerIndex.Three);
                }
            }

            if (World.ShipManager.SelectedPlayers.Any(p => p.PlayerStringToIndex == PlayerIndex.Four))
            {
                if (input.IsNewKeyPress(Keys.Up))
                {
                    ChangePlayerColour(PlayerIndex.Four);
                }

                if (input.IsNewKeyPress(Keys.RightAlt))
                {
                    ChangePlayerShip(PlayerIndex.Four);
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Event handler for when the Options menu entry is selected.
 /// </summary>
 void OptionsMenuEntrySelected(object sender, EventArgs e)
 {
     ScreenManager.AddScreen(new OptionsMenuScreen());
 }
Ejemplo n.º 4
0
 private void CreditsMenuEntrySelected(object sender, EventArgs e)
 {
     ScreenManager.AddScreen(new CreditsMenuScreen());
 }
Ejemplo n.º 5
0
 private void AboutMenuEntrySelected(object sender, EventArgs e)
 {
     ScreenManager.AddScreen(new AboutMenuScreen());
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Event handler for when the user selects ok on the "are you sure
 /// you want to exit" message box.
 /// </summary>
 void LoadMainMenuScreen(object sender, EventArgs e)
 {
     ScreenManager.AddScreen(new BackgroundScreen());
     ScreenManager.AddScreen(new MainMenuScreen());
 }