Beispiel #1
0
        // Update is called once per frame
        void Update()
        {
            // TEST
            if (Input.GetKeyDown(KeyCode.U))
            {
                // Hurt yourself when you press U
                player.Hurt(10, new Vector2(1, 1));
            }


            GetInput();
            player.Move(inputH);
            player.Climb(inputV);
            if (isJumping)
            {
                player.Jump();
            }
            if (isCrouching)
            {
                player.Crouch();
            }
            else
            {
                player.UnCrouch();
            }
        }
Beispiel #2
0
 // Update is called once per frame
 void Update()
 {
     GetInput();
     player.Move(inputH);
     player.Climb(inputV);
     if (isJumping)
     {
         player.Jump();
     }
     if (isCrouching)
     {
         player.Crouch();
     }
     else
     {
         player.UnCrouch();
     }
 }
Beispiel #3
0
 // Update is called once per frame
 void Update()
 {
     // Update input
     GetInput();
     //Control the Player with input
     player.Move(inputH);
     player.Climb(inputV);
     if (isJumping) //If jump input is made
     {
         // Make the controller jump
         player.Jump();
     }
     if (isCrouching) // if coruch input is made
     {
         // Make the controller crouch
         player.Crouch();
     }
     else //If the input is released
     {
         //Uncrouch the controller
         player.UnCrouch();
     }
 }