void Jump() { if (!objPlayer.isGrounded()) { if (objRope.getTimeToJump()) { objPlayer.JumpWithDog(); counter++; } } }
void Jump() { if (grounded && !gameOver) { SwitchJumpAnimation(); GetComponent <Rigidbody2D> ().velocity = new Vector2(GetComponent <Rigidbody2D> ().velocity.x, 0); GetComponent <Rigidbody2D> ().AddForce(new Vector2(0, jumpForce)); candoublejump = true; grounded = false; if (objRope.getTimeToJump()) { jumps++; } PlayJumpSound(); } if (gameOver) { RestartGame(); } }