bool tryToJumpOverObstacle() { if (jumpCoolDown == 0) { moveDelegate.requestJump(this); jumpCoolDown = JUMP_COOLDOWN_DURATION + (int)(Random.value * 50); return(true); } return(false); }
void Update() { alignFist(); if (Input.GetKeyUp(KeyCode.W)) { movementDelegate.requestJump(this); } if (Input.GetKeyUp(KeyCode.Space)) { this.fist.activate(Dirs.getRightIfTrue(isRightFacing()), 1); } handleXInput(); }