Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- For all interessted people here, i have found a very simple and nice method to implement the jump function:
- So, have fun with it and try the differet jump affects by changing the
- Ease(...)getInstance()
- .
- public static void jump()
- {
- final float jumpDuration = 0.8f;
- final int jumpHeight = 80;
- final float startY = Main.player.getY();
- final float peakY = startY - jumpHeight;
- SequenceEntityModifier jumpModifier = new SequenceEntityModifier(
- new MoveYModifier(jumpDuration, startY, peakY, EaseQuadOut.getInstance()),
- new MoveYModifier(jumpDuration, peakY, startY, EaseBounceOut.getInstance()));
- Main.player.registerEntityModifier(jumpModifier);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement