comparison 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
comparison
equal deleted inserted replaced
121:7b2660cc7861 122:d2b19131d537
102 return MainMenuState(self.game) 102 return MainMenuState(self.game)
103 elif e.type is MOVE_FOX_ID: 103 elif e.type is MOVE_FOX_ID:
104 self.cycle_count += 1 104 self.cycle_count += 1
105 if self.cycle_count > NIGHT_LENGTH: 105 if self.cycle_count > NIGHT_LENGTH:
106 return pygame.event.post(START_DAY) 106 return pygame.event.post(START_DAY)
107 return self.game.gameboard.move_foxes() 107 if self.game.gameboard.move_foxes():
108 # All foxes are gone/safe, so dawn happens
109 return pygame.event.post(START_DAY)
108 elif e.type is not QUIT: 110 elif e.type is not QUIT:
109 self.game.gameboard.event(e) 111 self.game.gameboard.event(e)
110 112
111 def loop(self): 113 def loop(self):
112 self.game.gameboard.loop() 114 self.game.gameboard.loop()