diff options
-rw-r--r-- | game.py | 29 |
1 files changed, 4 insertions, 25 deletions
@@ -80,7 +80,7 @@ class MazeGame: GOAL_COLOR = (0x00, 0xff, 0x00) WIN_COLOR = (0xff, 0xff, 0x00) - def __init__(self, screen): + def __init__(self, activity): # note what time it was when we first launched self.game_start_time = time.time() @@ -427,30 +427,9 @@ class MazeGame: return False def run(self): - """Run the main loop of the game.""" - # lets draw once before we enter the event loop - - clock = pygame.time.Clock() - pygame.display.flip() - - while self.running: - clock.tick(25) - a, b, c, d = pygame.cursors.load_xbm('my_cursor.xbm', - 'my_cursor_mask.xbm') - pygame.mouse.set_cursor(a, b, c, d) - self.frame += 1 - # process all queued events - for event in pausescreen.get_events(sleep_timeout=30): - self.processEvent(event) - - self.animate() - self.draw() - - pygame.display.update() - # don't animate faster than about 20 frames per second - # this keeps the speed reasonable and limits cpu usage - clock.tick(25) - + self.screen = pygame.display.get_surface() + pygame.display.init() + def harder(self): """Make a new maze that is harder than the current one.""" # both width and height must be odd |