Changeset 349:a36ab7dd0eb9


Ignore:
Timestamp:
Sep 5, 2009, 11:18:27 PM (11 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Convert:
svn:b4e93282-eac8-4b8b-b765-0f5d36de2b68@350
Message:

Fix 'Are You Sure?' dialog to work at night

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gamelib/engine.py

    r346 r349  
    187187
    188188        self.game.gameboard.lay_eggs()
    189 
    190     def event(self, e):
     189        self.dialog = None
     190
     191    def event(self, e):
     192        if self.dialog and self.dialog.running:
     193            if self.dialog.event(e):
     194                return
     195        elif self.dialog:
     196            if self.dialog.do_quit:
     197                self.dialog = None
     198                self.game.gameboard.reset_states()
     199                return GameOver(self.game)
     200            self.dialog=None
     201            return
    191202        if events_equal(e, START_DAY):
    192203            if self.game.gameboard.is_game_over():
     
    202213            pygame.time.set_timer(MOVE_FOX_ID, 4*self.cycle_time)
    203214        elif e.type is KEYDOWN and e.key == K_ESCAPE:
    204             if check_dialog(self.game.main_app):
    205                 self.game.gameboard.reset_states()
    206                 return GameOver(self.game)
     215            self.dialog = check_exit()
    207216        elif e.type is ANIM_ID:
    208217            self.game.gameboard.run_animations()
Note: See TracChangeset for help on using the changeset viewer.