我在Android應用程序中使用AndEngine和Box2d。
如何讓我的對象「玩家」拋出一個事件,並且「GameScene」訂閱它?Android自定義事件監聽器
public class Player {
@Override
public void Collision(GameObject object) {
if(object instanceof Coin) {
//throws an event here
}
}
}
public class GameScene {
private Player player = new Player();
//catch the event here
}