onupdatemanaged()
函数中检测到。我想玩一些破坏动画像爆炸!并在此功能中播放破坏的声音。请给我一些想法。
`private void addMesie(float x, final float f) {
tempx = x;
tempy = f;
this.mesile = new AnimatedSprite(x, f, this.MesileTextureRegion, this.getVertexBufferObjectManager()){
@Override
protected void onManagedUpdate(float pSecondsElapsed) {
super.onManagedUpdate(pSecondsElapsed);
this.setPosition(tempx , tempy);
if(laserCannon.collidesWith(this)){
}
}
};
this.mesile.animate(new long[]{100,100,100,100});
this.mesile.setVisible(false);
this.mScene.attachChild(mesile);
}`
答案 0 :(得分:0)
要在onManageUpdate中处理碰撞,请尝试使用ContactListener来检测不同对象的碰撞。在这里你也可以轻松播放声音。