2発の弾を反対方向に発射するシューティングゲームを持っているので、たまたま弾の始点に敵が近づくと(敵が弾の始点の範囲内にいると)エラーが発生し、
ここに私のコードがあります:
if((_target.collidesWith(bullet))){
resourcesManager.enemyPool.recyclePoolItem(_target);
targets.remove();
score=score+1;
}
if((_target.collidesWith(bullet2))){
resourcesManager.enemyPool.recyclePoolItem(_target);
targets.remove();
score=score+1;
break;
}
エラーログ:
09-30 09:47:23.530: E/AndroidRuntime(1167): in writeCrashedAppName, pkgName :com.www.tangent
09-30 09:47:23.550: I/Process(1167): Sending signal. PID: 1167 SIG: 9
09-30 09:47:23.550: E/AndroidRuntime(1167): FATAL EXCEPTION: UpdateThread
09-30 09:47:23.550: E/AndroidRuntime(1167): java.lang.IllegalStateException
09-30 09:47:23.550: E/AndroidRuntime(1167): at java.util.LinkedList$LinkIterator.remove(LinkedList.java:164)
09-30 09:47:23.550: E/AndroidRuntime(1167): at com.www.scene.WeaponSelectScene$1.onUpdate(WeaponSelectScene.java:318)
09-30 09:47:23.550: E/AndroidRuntime(1167): at org.andengine.engine.handler.UpdateHandlerList.onUpdate(UpdateHandlerList.java:47)
09-30 09:47:23.550: E/AndroidRuntime(1167): at org.andengine.entity.Entity.onManagedUpdate(Entity.java:1395)
09-30 09:47:23.550: E/AndroidRuntime(1167): at org.andengine.entity.scene.Scene.onManagedUpdate(Scene.java:284)
09-30 09:47:23.550: E/AndroidRuntime(1167): at org.andengine.entity.Entity.onUpdate(Entity.java:1167)
09-30 09:47:23.550: E/AndroidRuntime(1167): at org.andengine.entity.scene.Scene.onManagedUpdate(Scene.java:288)
09-30 09:47:23.550: E/AndroidRuntime(1167): at org.andengine.entity.Entity.onUpdate(Entity.java:1167)
09-30 09:47:23.550: E/AndroidRuntime(1167): at org.andengine.engine.Engine.onUpdateScene(Engine.java:591)
09-30 09:47:23.550: E/AndroidRuntime(1167): at org.andengine.engine.Engine.onUpdate(Engine.java:586)
09-30 09:47:23.550: E/AndroidRuntime(1167): at org.andengine.engine.LimitedFPSEngine.onUpdate(LimitedFPSEngine.java:56)
09-30 09:47:23.550: E/AndroidRuntime(1167): at org.andengine.engine.Engine.onTickUpdate(Engine.java:548)
09-30 09:47:23.550: E/AndroidRuntime(1167): at org.andengine.engine.Engine$UpdateThread.run(Engine.java:820)
09-30 09:47:23.570: I/BstWindowOrientationListener(521): getCurrentRotation(0)
09-30 09:47:23.570: I/ActivityManager(521): Process com.www.tangent (pid 1167) has died.
09-30 09:47:23.570: I/WindowManager(521): WIN DEATH: Window{b4846b48 SurfaceView paused=false}
09-30 09:47:23.590: E/InputDispatcher(521): channel 'b472fa40 com.www.tangent/com.www.tangent.GameActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8
09-30 09:47:23.590: E/InputDispatcher(521): channel 'b472fa40 com.www.tangent/com.www.tangent.GameActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
09-30 09:47:23.590: I/WindowManager(521): WIN DEATH: Window{b472fa40 com.www.tangent/com.www.tangent.GameActivity paused=false}