還是看提供的各種各樣的改性劑 - 以向上/向下移動,使用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()僅僅是一個例子 - 它會導致雪碧在反彈結束 - 有很多其他EaseFunctions可用。
您是否在使用AndEngine? – 2012-07-27 19:21:54