void Update()
    {
        //Defend input (key J)
        if (Input.GetKeyDown(KeyCode.J))
        {
            playerAnimation.Defend(true);

            shield.ActivateShield(true);
        }

        //Stop blocking with shield
        if (Input.GetKeyUp(KeyCode.J))
        {
            playerAnimation.UnFreezeAnimation();
            playerAnimation.Defend(false);

            shield.ActivateShield(false);
        }

        if (Input.GetKeyDown(KeyCode.K))
        {
            if (Random.Range(0, 2) > 0)
            {
                playerAnimation.Attack_1();

                soundFX.Attack_1();
            }
            else
            {
                playerAnimation.Attack_2();

                soundFX.Attack_2();
            }
        }
    }
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.J))
        {
            playerAnimation.Defend(true);
            shield.ActivateShield(true);
        }


        if (Input.GetKeyUp(KeyCode.J))
        {
            playerAnimation.UnFreezeAnimation();
            playerAnimation.Defend(false);
            shield.ActivateShield(false);
        }



        if (Input.GetKeyDown(KeyCode.K))
        {
            if (Random.Range(0, 2) > 0)
            {
                playerAnimation.Attack_1();
            }
            else
            {
                playerAnimation.Attack_2();
            }
        }
    }
Esempio n. 3
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.J))
        {
//            playerAnimation.FreezeAnimation();
            playerAnimation.Defend(true);
            shield.ActivateShield(true);
        }

        if (Input.GetKeyUp(KeyCode.J))
        {
            playerAnimation.UnFreezeAnimation();
            playerAnimation.Defend(false);
            shield.ActivateShield(false);
        }

        if (Input.GetKeyDown(KeyCode.L))
        {
            playerAnimation.Attack_0();
        }
        if (Input.GetKeyDown(KeyCode.K))
        {
            playerAnimation.Attack_1();
        }
    }
Esempio n. 4
0
    void defendNo()
    {
        playerAnimation.UnFreezeAnimation();
        playerAnimation.Defend(false);

        shield.ActivateShield(false);
    }
Esempio n. 5
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.J))//defend when J pressed is down
        {
            playerAnimation.Defend(true);
            playerShield.ActivatedShield(true);
        }

        if (Input.GetKeyUp(KeyCode.J))//release defence when J is released
        {
            playerAnimation.UnFreezeAnimation();
            playerAnimation.Defend(false);
            playerShield.ActivatedShield(false);
        }

        if (Input.GetKeyDown(KeyCode.K))
        {
            attackMovement.Attack(playerAnimation);
        }
    }
 // Update is called once per frame
 void Update()
 {   //when you press keys J- defend and K-attack
     if (Input.GetKeyDown(KeyCode.J))
     {
         playerAnimation.UnFreezeAnimation();
         playerAnimation.Defend(true);
     }
     if (Input.GetKeyUp(KeyCode.J))
     {
         playerAnimation.Defend(false);
     }
     if (Input.GetKeyDown(KeyCode.K))
     {
         if (Random.Range(0, 2) > 0)
         {
             playerAnimation.Attack_1();
         }
         else
         {
             playerAnimation.Attack_2();
         }
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (Input.GetMouseButtonDown(2))
     {
         playerAnimation.Defend(true);
     }
     if (Input.GetMouseButtonUp(2))
     {
         playerAnimation.UnFreezeAnimation();
         playerAnimation.Defend(false);
     }
     if (Input.GetMouseButtonDown(0))
     {
         if (Random.Range(0, 2) > 0)
         {
             playerAnimation.Attack_1();
         }
         else
         {
             playerAnimation.Attack_2();
         }
     }
 }