2

A friend is working on a game for his graduation project and he asked me for help fixing a rather tricky bug.
After a good hour and a half I admitted defeat and wrapped his entire game loop in a try-catch. It works flawlessly.

Comments
  • 0
    Next time starts with try catch then it won't defeat you again.

    Actually I usually prefer to try catch and alert so that I can discover problems easily. Luckily it's well going.
  • 0
    what was the exception message?
  • 0
    @DataJockey It was a ConcurrentModificationException. User input is being handled on a different thread (Swing UI thread) than the game logic and rendering, so when the user triggered an action that spawned a new entity at the exact moment that something on the game thread was iterating over the entity list, the whole thing crashed.
  • 0
    @franga2000 thx for sharing. Is there something like a ConcurrentQueue in Java?
Add Comment