aaron-jaeger / a-maze-in-space-game

0 stars 1 forks source link

fixes issue with game not restarting #46

Closed rob-miller-777 closed 6 years ago

rob-miller-777 commented 6 years ago

The issue was a race condition that for some reason only became apparent after the recent merge request. The bug was that my game loop could start without the flags being spawned, exiting the loop early and ending the game but not restarting it because the flags would spawn before the next step.

The fix was to let the game manager spawn the flags, instead of the start method on the flag manager. This will ensure they are always there before the game manager begins checking.