예제 #1
0
 bool tryToJumpOverObstacle()
 {
     if (jumpCoolDown == 0)
     {
         moveDelegate.requestJump(this);
         jumpCoolDown = JUMP_COOLDOWN_DURATION + (int)(Random.value * 50);
         return(true);
     }
     return(false);
 }
예제 #2
0
    void Update()
    {
        alignFist();
        if (Input.GetKeyUp(KeyCode.W))
        {
            movementDelegate.requestJump(this);
        }

        if (Input.GetKeyUp(KeyCode.Space))
        {
            this.fist.activate(Dirs.getRightIfTrue(isRightFacing()), 1);
        }
        handleXInput();
    }