daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Dec 16th, 2012 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. For all interessted people here, i have found a very simple and nice method to implement the jump function:
  2.  
  3. So, have fun with it and try the differet jump affects by changing the
  4. Ease(...)getInstance()  
  5. .
  6.  
  7. public static void jump()
  8. {
  9.         final float jumpDuration = 0.8f;
  10.         final int jumpHeight = 80;            
  11.         final float startY = Main.player.getY();
  12.         final float peakY = startY - jumpHeight;
  13.        
  14.         SequenceEntityModifier jumpModifier = new SequenceEntityModifier(
  15.                         new MoveYModifier(jumpDuration, startY, peakY, EaseQuadOut.getInstance()),
  16.                         new MoveYModifier(jumpDuration, peakY, startY, EaseBounceOut.getInstance()));
  17.        
  18. Main.player.registerEntityModifier(jumpModifier);
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top