我正在使用精灵和动画精灵。我使用了 16 帧动画精灵。对于左、右、上、下和最后 4 帧爆炸动画。
//animSprite.setCurrentTileIndex(leftCount);
当动画精灵与精灵碰撞时..我想显示最后 4 帧 5 秒。如何使用andengine。我尝试使用 Thread.sleep 但它不起作用。
//对于我正在使用的更新
scene.registerUpdateHandler(new IUpdateHandler() {
@Override
public void reset() {
}
@Override
public void onUpdate(final float pSecondsElapsed) {
checkCollision();
}
我可以在 logcat 中获得最后 4 帧数。但是屏幕没有更新..
如何刷新场景。
checkCollision()
{
if(sprite.collidesWith(animSprite))
try
{
for (int i = 0; i < 4; i++) {
animSprite.setCurrentTileIndex(animBlast);
Log.v("balst",""+animBlast);
animBlast++;
if (animBlast> 15) {
animBlast= 12;
}
Thread.sleep(10);
}
}
catch (Exception e) {
// e.printStackTrace();
}
}