或查看可用的各种修饰符 - 向上/向下移动,使用 MoveYModifier - 类似于
yourSprite.registerEntityModifier(new MoveYModifier(time, startY, endY, new IEntityModifierListener() {
@Override
public void onModifierStarted(final IModifier<IEntity> pModifier, final IEntity pItem) {
yourActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
//Do anything here that you want to happen when the Modifier starts - like start a sound playing, etc
}
});
}
@Override
public void onModifierFinished(final IModifier<IEntity> pEntityModifier, final IEntity pEntity) {
yourActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
//Do anything here that you want to happen after the Modifier is through - like stop playing a sound, etc
}
}
});
}
}, EaseBounceOut.getInstance()));
EaseBounceOut.getInstance() 只是一个例子——它会导致 Sprite 在最后反弹——还有很多其他的 EaseFunction 可用。