예제 #1
0
 public void Jump()
 {
     if (!hitCeiling)
     {
         verticalDirection = VerticalMovingDirection.Jumping;
     }
 }
예제 #2
0
 private void respondToEnemyKill()
 {
     if (bounceCounter > 0)
     {
         if (bounceCounter == Constants.marioBounceLimit)
         {
             verticalDirection = MarioPhysics.VerticalMovingDirection.Falling;
         }
         myMario.Jump();
         bounceCounter--;
         if (State.IsDead())
         {
             yVelocity -= 1;
         }
         else
         {
             yVelocity -= Constants.marioBounceDisplacement;
         }
     }
 }
예제 #3
0
 public void Crouch()
 {
     verticalDirection = VerticalMovingDirection.Falling;
 }
예제 #4
0
 public void Stand()
 {
     if (hitGround)
     {
         State.Stand();
         verticalDirection = VerticalMovingDirection.Falling;
     }
     else
     {
         verticalDirection = VerticalMovingDirection.None;
     }
     horizontalDirection = HorizontalMovingDirection.None;
     if ( (int)xVelocity != 0)
     {
         State.Slide();
     }
 }