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 CheckAttackButton_P2() { if (InputPlayerController.AttackButton_P2() && player2.GetEnableAttack() && player2.enumsPlayers.movimiento != EnumsPlayers.Movimiento.MoverAdelante && player2.enumsPlayers.movimiento != EnumsPlayers.Movimiento.MoverAtras && !InputPlayerController.CheckPressDeffenseButton_P2()) { //Debug.Log("JUGADOR 2 ATAQUE ACTIVED"); player2.SetControllerJoystick(true); if (player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Saltar && InputPlayerController.Vertical_Button_P2() < 0) { player2.spritePlayerActual.PlayAnimation("Ataque Abajo Salto protagonista"); enableMovementPlayer2 = false; } else if (player2.enumsPlayers.movimiento == EnumsPlayers.Movimiento.Saltar && InputPlayerController.Vertical_Button_P2() >= 0) { player2.spritePlayerActual.PlayAnimation("Ataque Salto protagonista"); enableMovementPlayer2 = false; } else { if (!player2.GetIsDuck()) { player2.spritePlayerActual.PlayAnimation("Ataque protagonista"); enableMovementPlayer2 = false; } else if (player2.GetIsDuck()) { player2.spritePlayerActual.PlayAnimation("Ataque Agachado protagonista"); enableMovementPlayer2 = false; } } } }
public void CheckSpritesAgachado_P2() { if (InputPlayerController.Vertical_Button_P2() < 0 && player2.enumsPlayers.movimiento != EnumsPlayers.Movimiento.Saltar) { if (InputPlayerController.CheckPressAttackButton_P2()) { player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.AgachadoAtaque; } else if (InputPlayerController.CheckPressDeffenseButton_P2()) { player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.AgachadoDefensa; } else { player2.spritePlayerActual.ActualSprite = SpritePlayer.SpriteActual.Agachado; } } }
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(); } } }
public void CheckDeffenceButton_P2() { if (!InputPlayerController.CheckPressAttackButton_P2()) { if (InputPlayerController.CheckPressDeffenseButton_P2()) { player2.SetControllerJoystick(true); player2.Deffence(); player2.boxColliderAgachado.state = BoxColliderController.StateBoxCollider.Defendido; player2.boxColliderParado.state = BoxColliderController.StateBoxCollider.Defendido; player2.boxColliderSaltando.state = BoxColliderController.StateBoxCollider.Defendido; player2.boxColliderSprite.state = BoxColliderController.StateBoxCollider.Defendido; } else { player2.boxColliderAgachado.state = BoxColliderController.StateBoxCollider.Normal; player2.boxColliderParado.state = BoxColliderController.StateBoxCollider.Normal; player2.boxColliderSaltando.state = BoxColliderController.StateBoxCollider.Normal; player2.boxColliderSprite.state = BoxColliderController.StateBoxCollider.Normal; } } }
public void CheckInputPlayer2() { if (player2 != null) { if (player2_PvP == null) { CheckVerticalUp_P2(); CheckVerticalDown_P2(); CheckVerticalCero_P2(); CheckHorizontalLeft_P2(); CheckHorizontalRight_P2(); CheckHorizontalCero_P2(); CheckAttackButton_P2(); CheckDeffenceButton_P2(); CheckSpecialAttackButton_P2(); } else { switch (player2_PvP.playerSelected) { case Player_PvP.PlayerSelected.Agresivo: CheckVerticalUp_P2(); CheckVerticalCero_P2(); CheckHorizontalLeft_P2(); CheckHorizontalRight_P2(); CheckHorizontalCero_P2(); CheckAttackButton_P2(); CheckDeffenceButton_P2(); CheckSpecialAttackButton_P2(); break; case Player_PvP.PlayerSelected.Balanceado: CheckVerticalUp_P2(); CheckVerticalDown_P2(); CheckVerticalCero_P2(); CheckHorizontalLeft_P2(); CheckHorizontalRight_P2(); CheckHorizontalCero_P2(); CheckAttackButton_P2(); CheckDeffenceButton_P2(); CheckSpecialAttackButton_P2(); break; case Player_PvP.PlayerSelected.Defensivo: CheckVerticalCero_P2(); CheckHorizontalLeft_P2(); CheckHorizontalRight_P2(); CheckHorizontalCero_P2(); CheckAttackButton_P2(); CheckDeffenceButton_P2(); CheckSpecialAttackButton_P2(); break; case Player_PvP.PlayerSelected.Protagonista: CheckVerticalUp_P2(); CheckVerticalDown_P2(); CheckVerticalCero_P2(); CheckHorizontalLeft_P2(); CheckHorizontalRight_P2(); CheckHorizontalCero_P2(); CheckAttackButton_P2(); CheckDeffenceButton_P2(); CheckSpecialAttackButton_P2(); break; } } if (!InputPlayerController.CheckPressDeffenseButton_P2() && !player2.GetIsJumping() && player2.enumsPlayers.movimiento != EnumsPlayers.Movimiento.Saltar && player2.enumsPlayers.movimiento != EnumsPlayers.Movimiento.SaltoAtaque && player2.enumsPlayers.movimiento != EnumsPlayers.Movimiento.SaltoDefensa) { player2.gridPlayer.CheckCuadrillaOcupada(player2.structsPlayer.dataPlayer.columnaActual, player2.structsPlayer.dataPlayer.CantCasillasOcupadas_X, player2.structsPlayer.dataPlayer.CantCasillasOcupadas_Y); } } }