コード例 #1
0
 private void AddPlayer( ref SignInSlot slot, PlayerIndex playerIndex )
 {
     slot.Slot.Player = playerIndex;
       slot.Slot.Avatar = new Avatar( Gamer.SignedInGamers[playerIndex].Avatar, AvatarAnimationPreset.Stand0,
                              1f, Vector3.UnitZ, Vector3.Zero );
       activeBots.Remove( (int)playerIndex );
       GameCore.Instance.AudioManager.Play2DCue( "signIn", 1f );
 }
コード例 #2
0
 public void OnButtonYHit( PlayerIndex playerIndex, ref SignInSlot slot )
 {
     RemoveLastBot();
 }
コード例 #3
0
        public void OnButtonBHit( PlayerIndex playerIndex, ref SignInSlot slot )
        {
            //int numPlayers = slots.Count( s => s.Slot.Player != NoPlayer );
              int numHumans = slots.Count( s => s.Slot.Player.IsHuman() );

              if ( slot.Ready )
              {
            slot.Ready = false;
              }
              //else if ( numPlayers <= 1 )
              //{
              //  if ( numHumans == 0 || numPlayers == 0 || numPlayers == 1 && slot.Slot.Player.IsHuman() )
              //    OnCancel( playerIndex );
              //}
              else if ( numHumans == 1 )
              {
            while ( activeBots.Count > 0 )
              RemoveLastBot();
            OnCancel( playerIndex );
              }
              else
              {
            slot.Slot.Player = NoPlayer;
            slot.Slot.Avatar = null;
            GameCore.Instance.AudioManager.Play2DCue( "signOut", 1f );
              }
        }
コード例 #4
0
 public void OnButtonXHit( PlayerIndex playerIndex, ref SignInSlot slot )
 {
     AddBot();
 }
コード例 #5
0
        public void OnButtonAHit( PlayerIndex playerIndex, ref SignInSlot slot )
        {
            if ( slot.Slot.Player < PlayerIndex.One )
              {
            if ( Guide.IsTrialMode && slots.Count( s => s.Slot.Player.IsHuman() ) > 0 )
            {
              nagText.DeathBegin = (float)lastGameTime.TotalGameTime.TotalSeconds;

              MessageBoxScreen messageBox = new MessageBoxScreen( "Full version required for Multiplayer. " +
                                                              "Buy Avatar Hamster Panic now?" );
              messageBox.Accepted += GameCore.Instance.ShowBuy;
              ScreenManager.AddScreen( messageBox, null );
            }
            else
            {
              bool found = false;
              foreach ( SignedInGamer gamer in Gamer.SignedInGamers )
              {
            if ( gamer.PlayerIndex == playerIndex )
            {
              found = true;
              break;
            }
              }

              if ( !found )
              {
            Guide.ShowSignIn( 4, false );
            autoSignIn = true;
              }
              else
              {
            AddPlayer( ref slot, playerIndex );
              }
            }
              }
              else if ( slot.Ready == false )
              {
            GameCore.Instance.AudioManager.Play2DCue( "readyUp", 1f );
            slot.Ready = true;
              }

              if ( slots.Count( s => s.Slot.Player.IsHuman() ) != 0 )
              {
            if ( slots.Count( s => s.Slot.Player.IsHuman() && !s.Ready ) == 0 )
            {
              Slot[] initSlots = new Slot[4];
              for ( int i = 0; i < 4; ++i )
            initSlots[i] = slots[i].Slot;
              GameCore.Instance.AudioManager.Play2DCue( "startGame", 1f );
              //ScreenManager.MenuTrack.Pause();
              LoadingScreen.Load( ScreenManager, true, playerIndex, new GameplayScreen( initSlots ) );
            }
              }
        }