I am developing a Game in which sprite have to jump forward .
I already explore it and used MoveYModifier for up and then MoveYModifier for down again it is working right except on more then one tap on the screen.But I want to move him forward as well while jump.
final Entity playerEntity = move;
final float jumpDuration = 3;
final float startX = playerEntity.getX();
final float jumpHeight = 100;
final MoveXModifier moveUpModifier = new MoveXModifier(jumpDuration / 2, startX, startX - jumpHeight); // - since we want the sprite to go up.
final MoveXModifier moveDownModifier = new MoveXModifier(jumpDuration / 2,startX - jumpHeight, startX);
final SequenceEntityModifier modifier = new SequenceEntityModifier(moveUpModifier, moveDownModifier);
playerEntity.registerEntityModifier(modifier);
return true;
Instead of using MoveXModifier why not just use the MoveModifier?
https://github.com/nicolasgramlich/AndEngine/blob/GLES2/src/org/andengine/entity/modifier/MoveModifier.java