Advertisement
luluco250

Untitled

Apr 11th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.28 KB | None | 0 0
  1. switch (axis) {
  2.                 default:
  3.                     CheckSide(Input.GetAxis("LX"));
  4.                     rb2d.AddForce(transform.right * Input.GetAxis("LX") * speed * accumulatedSpeed);
  5.                     accumulatedSpeed = 1;
  6.                     rb2d.AddForce(new Vector2(-rb2d.velocity.x, 0));
  7.                     if (Input.GetButtonDown("A")) {
  8.                         jumpForce += Time.deltaTime;
  9.                         ballVelocity = jumpRotationSpeed;
  10.                         isBall = true;
  11.                     }
  12.                     else {
  13.                         jumpForce = 0;
  14.                     }
  15.                     rb2d.AddForce(transform.up * jump * jumpForce);
  16.                     break;
  17.                 case 1:
  18.                     //if (!anim.GetBool("grounded")) anim.SetBool("isBall", false);
  19.                     if (Input.GetButton("A")) accumulatedSpeed = Mathf.Clamp(accumulatedSpeed + pellOutSpeedUpFactor, 0, maxPellOutSpeedMultiplier);
  20.                     break;
  21.                 case -1:
  22.                     //if (rb2d.velocity.x > 0.005f) anim.SetBool("isBall", true);
  23.                     if (Input.GetButton("A")) accumulatedSpeed = Mathf.Clamp(accumulatedSpeed + spinDashSpeedUpFactor, 0, maxSpinDashSpeedMultiplier);
  24.                     break;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement