Пример #1
0
 /**
  * Causes this GameObject to jump if the jumping flag is set and this object is not already
  * jumping.
  */
 public void setJumping(boolean isJumping) {
   if (isJumping() != isJumping) {
     super.setJumping(isJumping);
     if (isJumping) {
       Physics.getInstance().jump(this, jumpVelocity);
     }
   }
 }
Пример #2
0
 /** Sets how high this GameObject can jump. */
 public void setJumpHeight(float jumpHeight) {
   jumpVelocity = Physics.getInstance().getJumpVelocity(jumpHeight);
 }