Exemplo n.º 1
0
 public void CheckSpritesSalto_P1()
 {
     if (InputPlayerController.Vertical_Button_P1() > 0 && InputPlayerController.Horizontal_Button_P1() == 0 && player1.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Nulo || player1.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Saltar || player1.enumsPlayers.movimiento == EnumsPlayers.Movimiento.SaltoAtaque || player1.enumsPlayers.movimiento == EnumsPlayers.Movimiento.SaltoDefensa)
     {
         if (InputPlayerController.CheckPressAttackButton_P1())
         {
             player1.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.SaltoAtaque;
         }
         else if (InputPlayerController.CheckPressDeffenseButton_P1())
         {
             player1.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.SaltoDefensa;
         }
         else if (InputPlayerController.SpecialAttackButton_P1())
         {
             //SPRITE O ANIMACION ATAQUE ESPECIAL JUGADOR.
         }
         else
         {
             player1.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.Salto;
         }
         if (player1.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Nulo)
         {
             player1.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.Parado;
         }
     }
 }
Exemplo n.º 2
0
 public void CheckAttackButton_P1()
 {
     if (InputPlayerController.AttackButton_P1() && player1.GetEnableAttack() &&
         player1.enumsPlayers.movimiento != EnumsPlayers.Movimiento.MoverAdelante &&
         player1.enumsPlayers.movimiento != EnumsPlayers.Movimiento.MoverAtras &&
         !InputPlayerController.CheckPressDeffenseButton_P1())
     {
         //Debug.Log("JUGADOR 1 ATAQUE ACTIVED");
         player1.SetControllerJoystick(true);
         if (player1.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Saltar && InputPlayerController.Vertical_Button_P1() < 0)
         {
             player1.spritePlayerActual.PlayAnimation("Ataque Abajo Salto protagonista");
             enableMovementPlayer1 = false;
         }
         else if (player1.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Saltar && InputPlayerController.Vertical_Button_P1() >= 0)
         {
             player1.spritePlayerActual.PlayAnimation("Ataque Salto protagonista");
             enableMovementPlayer1 = false;
         }
         else
         {
             if (!player1.GetIsDuck())
             {
                 player1.spritePlayerActual.PlayAnimation("Ataque protagonista");
                 enableMovementPlayer1 = false;
             }
             else if (player1.GetIsDuck())
             {
                 player1.spritePlayerActual.PlayAnimation("Ataque Agachado protagonista");
                 enableMovementPlayer1 = false;
             }
         }
     }
 }
Exemplo n.º 3
0
 public void CheckSpritesAgachado_P1()
 {
     if (InputPlayerController.Vertical_Button_P1() < 0 && player1.enumsPlayers.movimiento != EnumsPlayers.Movimiento.Saltar)
     {
         if (InputPlayerController.CheckPressAttackButton_P1())
         {
             player1.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.AgachadoAtaque;
         }
         else if (InputPlayerController.CheckPressDeffenseButton_P1())
         {
             player1.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.AgachadoDefensa;
         }
         else
         {
             player1.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.Agachado;
         }
     }
 }
Exemplo n.º 4
0
 public void CheckDeffenceButton_P1()
 {
     if (!InputPlayerController.CheckPressAttackButton_P1())
     {
         if (InputPlayerController.CheckPressDeffenseButton_P1())
         {
             player1.SetControllerJoystick(true);
             player1.Deffence();
             player1.boxColliderAgachado.state = BoxColliderController.StateBoxCollider.Defendido;
             player1.boxColliderParado.state   = BoxColliderController.StateBoxCollider.Defendido;
             player1.boxColliderSaltando.state = BoxColliderController.StateBoxCollider.Defendido;
             player1.boxColliderSprite.state   = BoxColliderController.StateBoxCollider.Defendido;
         }
         else
         {
             player1.boxColliderAgachado.state = BoxColliderController.StateBoxCollider.Normal;
             player1.boxColliderParado.state   = BoxColliderController.StateBoxCollider.Normal;
             player1.boxColliderSaltando.state = BoxColliderController.StateBoxCollider.Normal;
             player1.boxColliderSprite.state   = BoxColliderController.StateBoxCollider.Normal;
         }
     }
 }
Exemplo n.º 5
0
 public void CheckSpritesParado_P1()
 {
     if (player1.enumsPlayers.movimiento != EnumsPlayers.Movimiento.Saltar &&
         player1.enumsPlayers.movimiento != EnumsPlayers.Movimiento.Agacharse && InputPlayerController.Horizontal_Button_P1() == 0)
     {
         if (InputPlayerController.CheckPressAttackButton_P1())
         {
             player1.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.ParadoAtaque;
         }
         else if (InputPlayerController.CheckPressDeffenseButton_P1())
         {
             player1.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.ParadoDefensa;
             if (player1_PvP != null)
             {
                 player1_PvP.playerState = Player_PvP.State.Defendido;
             }
         }
         else
         {
             player1.spritePlayerActual.ActualSprite            = SpritePlayer.SpriteActual.Parado;
             player1.spritePlayerActual.delaySpriteRecibirDanio = player1.spritePlayerActual.GetAuxDelaySpriteRecibirDanio();
         }
     }
 }
Exemplo n.º 6
0
        public void CheckInputPlayer1()
        {
            if (player1_PvP == null)
            {
                CheckVerticalUp_P1();
                CheckVerticalDown_P1();
                CheckVerticalCero_P1();
                CheckHorizontalLeft_P1();
                CheckHorizontalRight_P1();
                CheckHorizontalCero_P1();
                CheckAttackButton_P1();
                CheckDeffenceButton_P1();
                CheckSpecialAttackButton_P1();
            }
            else
            {
                switch (player1_PvP.playerSelected)
                {
                case Player_PvP.PlayerSelected.Agresivo:
                    CheckVerticalUp_P1();
                    CheckVerticalCero_P1();
                    CheckHorizontalLeft_P1();
                    CheckHorizontalRight_P1();
                    CheckHorizontalCero_P1();
                    CheckAttackButton_P1();
                    CheckDeffenceButton_P1();
                    CheckDeffenceButton_P1();
                    CheckSpecialAttackButton_P1();
                    break;

                case Player_PvP.PlayerSelected.Balanceado:
                    CheckVerticalUp_P1();
                    CheckVerticalDown_P1();
                    CheckVerticalCero_P1();
                    CheckHorizontalLeft_P1();
                    CheckHorizontalRight_P1();
                    CheckHorizontalCero_P1();
                    CheckAttackButton_P1();
                    CheckDeffenceButton_P1();
                    CheckSpecialAttackButton_P1();
                    break;

                case Player_PvP.PlayerSelected.Defensivo:
                    CheckVerticalCero_P1();
                    CheckHorizontalLeft_P1();
                    CheckHorizontalRight_P1();
                    CheckHorizontalCero_P1();
                    CheckAttackButton_P1();
                    CheckDeffenceButton_P1();
                    CheckSpecialAttackButton_P1();
                    break;

                case Player_PvP.PlayerSelected.Protagonista:
                    CheckVerticalUp_P1();
                    CheckVerticalDown_P1();
                    CheckVerticalCero_P1();
                    CheckHorizontalLeft_P1();
                    CheckHorizontalRight_P1();
                    CheckHorizontalCero_P1();
                    CheckAttackButton_P1();
                    CheckDeffenceButton_P1();
                    CheckSpecialAttackButton_P1();
                    break;
                }
            }
            if (!InputPlayerController.CheckPressDeffenseButton_P1() && !player1.GetIsJumping() &&
                player1.enumsPlayers.movimiento != EnumsPlayers.Movimiento.Saltar &&
                player1.enumsPlayers.movimiento != EnumsPlayers.Movimiento.SaltoAtaque &&
                player1.enumsPlayers.movimiento != EnumsPlayers.Movimiento.SaltoDefensa)
            {
                player1.gridPlayer.CheckCuadrillaOcupada(player1.structsPlayer.dataPlayer.columnaActual, player1.structsPlayer.dataPlayer.CantCasillasOcupadas_X, player1.structsPlayer.dataPlayer.CantCasillasOcupadas_Y);
            }
        }