comparison gamelib/engine.py @ 411:03d5cb669298

Add config file and command line parameters.
author Jeremy Thurgood <firxen@gmail.com>
date Sat, 21 Nov 2009 11:18:08 +0000
parents 19e583e5cdc0
children 1e24eedbf40f
comparison
equal deleted inserted replaced
410:e83ec14163f2 411:03d5cb669298
146 if events_equal(e, START_NIGHT): 146 if events_equal(e, START_NIGHT):
147 self.game.gameboard.reset_states() 147 self.game.gameboard.reset_states()
148 return NightState(self.game) 148 return NightState(self.game)
149 elif e.type is KEYDOWN and e.key == K_ESCAPE: 149 elif e.type is KEYDOWN and e.key == K_ESCAPE:
150 self.dialog = check_exit() 150 self.dialog = check_exit()
151 elif e.type is ANIM_ID:
152 self.game.gameboard.run_animations()
153 elif e.type is KEYDOWN and e.key == K_n: 151 elif e.type is KEYDOWN and e.key == K_n:
154 return pygame.event.post(START_NIGHT) 152 return pygame.event.post(START_NIGHT)
155 elif events_equal(e, GO_MAIN_MENU): 153 elif events_equal(e, GO_MAIN_MENU):
156 return MainMenuState(self.game) 154 return MainMenuState(self.game)
157 elif e.type is not QUIT: 155 elif e.type is not QUIT:
210 self.cycle_time = SLOW_ANIM_SPEED 208 self.cycle_time = SLOW_ANIM_SPEED
211 pygame.time.set_timer(ANIM_ID, self.cycle_time) 209 pygame.time.set_timer(ANIM_ID, self.cycle_time)
212 pygame.time.set_timer(MOVE_FOX_ID, 4*self.cycle_time) 210 pygame.time.set_timer(MOVE_FOX_ID, 4*self.cycle_time)
213 elif e.type is KEYDOWN and e.key == K_ESCAPE: 211 elif e.type is KEYDOWN and e.key == K_ESCAPE:
214 self.dialog = check_exit() 212 self.dialog = check_exit()
215 elif e.type is ANIM_ID:
216 self.game.gameboard.run_animations()
217 elif e.type is MOVE_FOX_ID: 213 elif e.type is MOVE_FOX_ID:
218 # ensure no timers trigger while we're running 214 # ensure no timers trigger while we're running
219 pygame.time.set_timer(ANIM_ID, 0) 215 pygame.time.set_timer(ANIM_ID, 0)
220 pygame.time.set_timer(MOVE_FOX_ID, 0) 216 pygame.time.set_timer(MOVE_FOX_ID, 0)
221 # Clear any queued timer events, so we don't full the queue 217 # Clear any queued timer events, so we don't full the queue