public void CheckSpritesSalto_P2()
 {
     if (InputPlayerController.Vertical_Button_P2() > 0 && InputPlayerController.Horizontal_Button_P2() == 0 && player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Nulo || player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Saltar || player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.SaltoAtaque || player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.SaltoDefensa)
     {
         if (InputPlayerController.CheckPressAttackButton_P2())
         {
             player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.SaltoAtaque;
         }
         else if (InputPlayerController.CheckPressDeffenseButton_P2())
         {
             player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.SaltoDefensa;
         }
         else if (InputPlayerController.SpecialAttackButton_P2())
         {
             //SPRITE O ANIMACION ATAQUE ESPECIAL JUGADOR.
         }
         else
         {
             player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.Salto;
         }
         if (player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Nulo)
         {
             player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.Parado;
         }
     }
 }
 public void CheckHorizontalCero_P2()
 {
     if (InputPlayerController.Horizontal_Button_P2() == 0)
     {
         moveHorizontalPlayer2 = true;
     }
 }
 public void CheckHorizontalRight_P2()
 {
     if (player2.LookingForward)
     {
         if (InputPlayerController.Horizontal_Button_P2() > 0 && moveHorizontalPlayer2 && player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Nulo ||
             player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.MoverAdelante)
         {
             player2.SetControllerJoystick(true);
             moveHorizontalPlayer2 = false;
             player2.MovementRight();
             player2.SetIsDuck(false);
         }
     }
     else if (player2.LookingBack)
     {
         if (InputPlayerController.Horizontal_Button_P2() > 0 && moveHorizontalPlayer2 && player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Nulo ||
             player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.MoverAdelante)
         {
             player2.SetControllerJoystick(true);
             moveHorizontalPlayer2 = false;
             player2.MovementRight();
             player2.SetIsDuck(false);
         }
     }
 }
 public void CheckSpriteMoverAdelante_P2()
 {
     if (InputPlayerController.Horizontal_Button_P2() < 0 && InputPlayerController.Vertical_Button_P2() == 0 ||
         player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.MoverAtras)
     {
         if (player2.structsPlayer.dataPlayer.columnaActual > 0)
         {
             player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.MoverAdelante;
         }
         else
         {
             player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.Parado;
         }
     }
 }
 public void CheckSpriteMoverAtras_P2()
 {
     if (InputPlayerController.Horizontal_Button_P2() > 0 && InputPlayerController.Vertical_Button_P2() == 0 ||
         player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.MoverAdelante)
     {
         if (player2.structsPlayer.dataPlayer.columnaActual < player2.gridPlayer.GetCuadrilla_columnas() - 1)
         {
             player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.MoverAtras;
         }
         else
         {
             player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.Parado;
         }
     }
 }
Beispiel #6
0
        public void MoveCursor()
        {
            //---MOVIMIENTO DEL CURSOR DEL PLAYER 1---//
            if (cursorPlayer1.x >= 0 && cursorPlayer1.x < filas)
            {
                if (InputPlayerController.Horizontal_Button_P1() > 0 && cursorPlayer1.x < filas - 1)
                {
                    if (aviableMoveHorizontalP1)
                    {
                        cursorPlayer1.x++;
                        CursorSelectorPlayer1.MoveRight();
                        aviableMoveHorizontalP1 = false;
                    }
                }
                else if (InputPlayerController.Horizontal_Button_P1() < 0 && cursorPlayer1.x > 0)
                {
                    if (aviableMoveHorizontalP1)
                    {
                        cursorPlayer1.x--;
                        CursorSelectorPlayer1.MoveLeft();
                        aviableMoveHorizontalP1 = false;
                    }
                }
            }
            if (cursorPlayer1.y >= 0 && cursorPlayer1.y < columnas)
            {
                if (InputPlayerController.Vertical_Button_P1() > 0 && cursorPlayer1.y > 0)
                {
                    if (aviableMoveVerticalP1)
                    {
                        cursorPlayer1.y--;
                        CursorSelectorPlayer1.MoveUp();
                        aviableMoveVerticalP1 = false;
                    }
                }
                else if (InputPlayerController.Vertical_Button_P1() < 0 && cursorPlayer1.y < columnas - 1)
                {
                    if (aviableMoveVerticalP1)
                    {
                        cursorPlayer1.y++;
                        CursorSelectorPlayer1.MoveDown();
                        aviableMoveVerticalP1 = false;
                    }
                }
            }
            if (InputPlayerController.Vertical_Button_P1() == 0)
            {
                aviableMoveVerticalP1 = true;
            }
            if (InputPlayerController.Horizontal_Button_P1() == 0)
            {
                aviableMoveHorizontalP1 = true;
            }
            //----------------------------------------//

            //---MOVIMIENTO DEL CURSOR DEL PLAYER 2---//
            if (cursorPlayer2.x >= 0 && cursorPlayer2.x < filas)
            {
                if (InputPlayerController.Horizontal_Button_P2() > 0 && cursorPlayer2.x < filas - 1)
                {
                    if (aviableMoveHorizontalP2)
                    {
                        cursorPlayer2.x++;
                        CursorSelectorPlayer2.MoveRight();
                        aviableMoveHorizontalP2 = false;
                    }
                }
                else if (InputPlayerController.Horizontal_Button_P2() < 0 && cursorPlayer2.x > 0)
                {
                    if (aviableMoveHorizontalP2)
                    {
                        cursorPlayer2.x--;
                        CursorSelectorPlayer2.MoveLeft();
                        aviableMoveHorizontalP2 = false;
                    }
                }
            }
            if (cursorPlayer2.y >= 0 && cursorPlayer2.y < columnas)
            {
                if (InputPlayerController.Vertical_Button_P2() > 0 && cursorPlayer2.y > 0)
                {
                    if (aviableMoveVerticalP2)
                    {
                        cursorPlayer2.y--;
                        CursorSelectorPlayer2.MoveUp();
                        aviableMoveVerticalP2 = false;
                    }
                }
                else if (InputPlayerController.Vertical_Button_P2() < 0 && cursorPlayer2.y < columnas - 1)
                {
                    if (aviableMoveVerticalP2)
                    {
                        cursorPlayer2.y++;
                        CursorSelectorPlayer2.MoveDown();
                        aviableMoveVerticalP2 = false;
                    }
                }
            }
            if (InputPlayerController.Vertical_Button_P2() == 0)
            {
                aviableMoveVerticalP2 = true;
            }
            if (InputPlayerController.Horizontal_Button_P2() == 0)
            {
                aviableMoveHorizontalP2 = true;
            }
            //----------------------------------------//
        }
 public void CheckSpritesParado_P2()
 {
     if (player2.enumsPlayers.movimiento != EnumsPlayers.Movimiento.Saltar &&
         player2.enumsPlayers.movimiento != EnumsPlayers.Movimiento.Agacharse && InputPlayerController.Horizontal_Button_P2() == 0)
     {
         if (InputPlayerController.CheckPressAttackButton_P2())
         {
             player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.ParadoAtaque;
         }
         else if (InputPlayerController.CheckPressDeffenseButton_P2())
         {
             player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.ParadoDefensa;
             player2_PvP.playerState = Player_PvP.State.Defendido;
         }
         else
         {
             player2.spritePlayerActual.ActualSprite            = SpritePlayer.SpriteActual.Parado;
             player2.spritePlayerActual.delaySpriteRecibirDanio = player2.spritePlayerActual.GetAuxDelaySpriteRecibirDanio();
         }
     }
 }