Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- switch (axis) {
- default:
- CheckSide(Input.GetAxis("LX"));
- rb2d.AddForce(transform.right * Input.GetAxis("LX") * speed * accumulatedSpeed);
- accumulatedSpeed = 1;
- rb2d.AddForce(new Vector2(-rb2d.velocity.x, 0));
- if (Input.GetButtonDown("A")) {
- jumpForce += Time.deltaTime;
- ballVelocity = jumpRotationSpeed;
- isBall = true;
- }
- else {
- jumpForce = 0;
- }
- rb2d.AddForce(transform.up * jump * jumpForce);
- break;
- case 1:
- //if (!anim.GetBool("grounded")) anim.SetBool("isBall", false);
- if (Input.GetButton("A")) accumulatedSpeed = Mathf.Clamp(accumulatedSpeed + pellOutSpeedUpFactor, 0, maxPellOutSpeedMultiplier);
- break;
- case -1:
- //if (rb2d.velocity.x > 0.005f) anim.SetBool("isBall", true);
- if (Input.GetButton("A")) accumulatedSpeed = Mathf.Clamp(accumulatedSpeed + spinDashSpeedUpFactor, 0, maxSpinDashSpeedMultiplier);
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement