diff gamelib/engine.py @ 122:d2b19131d537

Don't continue the night if we're not doing anything anymore
author Neil Muller <drnlmuller@gmail.com>
date Wed, 02 Sep 2009 20:54:47 +0000
parents 2c76ed47fc44
children 1d73de63bd71
line wrap: on
line diff
--- a/gamelib/engine.py	Wed Sep 02 20:54:45 2009 +0000
+++ b/gamelib/engine.py	Wed Sep 02 20:54:47 2009 +0000
@@ -104,7 +104,9 @@
             self.cycle_count += 1
             if self.cycle_count > NIGHT_LENGTH:
                 return pygame.event.post(START_DAY)
-            return self.game.gameboard.move_foxes()
+            if self.game.gameboard.move_foxes():
+                # All foxes are gone/safe, so dawn happens
+                return pygame.event.post(START_DAY)
         elif e.type is not QUIT:
             self.game.gameboard.event(e)