//@Override public override void UpdateObjects(GameTime gameTime) { base.UpdateObjects(gameTime); lock (particularObjects){ for (int id = 0; id < particularObjects.Count; id++) { ParticularObject obj = particularObjects[id]; if (obj.isObjectOutOfCameraView() || obj.getState() == GameObject.MainState.DEATH) { particularObjects.RemoveAt(id); //System.out.println("Remove"); } } } }
public virtual void UpdateObjects(GameTime gameTime) { lock (particularObjects){ for (int id = 0; id < particularObjects.Count; id++) { ParticularObject obj = particularObjects[id]; if (!obj.isObjectOutOfCameraView()) { obj.Update(gameTime); } if (obj.getState() == GameObject.MainState.DEATH) { particularObjects.RemoveAt(id); } } } //System.out.println("Camerawidth = "+camera.getWidth()); }