コード例 #1
0
        private void StartGame(PlayerIndex inputIndex)
        {
            GameResources.PlaySession = new PlaySession(); // Depend on the screen manager to clean this up.

            PlayerInfo playerOne = new PlayerInfo(0, PlayerInfo.PlayerType.Local);

            GameResources.PlaySession.Players.Add(playerOne);
            GameResources.PlaySession.LocalPlayers.Add(playerOne.PlayerId, inputIndex);

            // TODO: P2: Go through character selection screen first.

            PlayRequest testPlay = new PlayRequest();

            testPlay.LevelName = "levels\\Hub";
            CharacterInfo testChar = new CharacterInfo();

            testChar.TemplateName = "Mechadrone";
            testPlay.CharacterSelections.Add(playerOne.PlayerId, testChar);

            LoadingScreen.Load(ScreenManager, true, inputIndex, new GameplayScreen(testPlay));
        }
コード例 #2
0
        private void LoadNewLevel(string levelName)
        {
            PlayRequest pr = new PlayRequest();

            pr.LevelName = levelName;
            for (int p = 0; p < GameResources.PlaySession.Players.Count; ++p)
            {
                CharacterInfo testChar;
                if (p < GameResources.GameDossier.Characters.Count)
                {
                    testChar = GameResources.GameDossier.Characters[p];
                }
                else
                {
                    testChar = new CharacterInfo();
                }

                pr.CharacterSelections.Add(GameResources.PlaySession.Players[p].PlayerId, testChar);
            }

            LoadingScreen.Load(ScreenManager, true, ControllingPlayer, new GameplayScreen(pr));
        }
コード例 #3
0
 /// <summary>
 /// Event handler for when the user selects ok on the "are you sure
 /// you want to quit" message box. This uses the loading screen to
 /// transition from the game back to the main menu screen.
 /// </summary>
 void ConfirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
 }