コード例 #1
0
 void handleJumpInput2()
 {
     if (!MyInput.GetJump() || inTrampolinUp)
     {
         if (alreadyPressedJump)
         {
             alreadyPressedJump = false;
         }
         if (rBody.velocity.y > 0f)
         {
             rBody.velocity = new Vector2(rBody.velocity.x, rBody.velocity.y * 0.6f);
         }
         //jumpFrames = maxJumpFrames + 1;
     }
 }
コード例 #2
0
ファイル: MoveRB.cs プロジェクト: tomfionn/FireBonobo
    void Update()
    {
        // Check jump
        switch (SM.Instance.state)
        {
        case SM.State.Grounded:
            if (MyInput.GetJump())
            {
                m_applyJump = true;
            }
            break;

        default:
            break;
        }
    }
コード例 #3
0
 void handleJumpInput1()
 {
     if (!alreadyPressedJump && !inTrampolin && MyInput.GetJump())
     {
         if (grounded /*|| !jumpedTwice*/)
         {
             //if (!grounded) {
             //	jumpedTwice = true;
             //	Jump ();
             //} else {
             singleStompSource.pitch = 0.8f;
             singleStompSource.Play();
             Jump();
             VibrateController.vibrateControllerForXSeconds(0.05f, 0.2f, 0.2f);
             //anim.SetBool ("Ground", false);
             //}
         }
         else if (CanWallJump && !alreadyWallJumped)
         {
             if (huggingFrontWall)
             {
                 JumpBackward();
                 alreadyWallJumped = true;
             }
             else if (huggingBackWall)
             {
                 JumpForward();
                 alreadyWallJumped = true;
             }
             else
             {
                 jumpNext = true;
             }
         }
     }
 }