From db1083c3b39dcfdd98e40be57f1e795b20a219d1 Mon Sep 17 00:00:00 2001 From: Kshitij Kumar Date: Mon, 07 Jan 2013 14:41:13 +0000 Subject: game.py fixes --- diff --git a/game.py b/game.py index 4f904d5..882385a 100644 --- a/game.py +++ b/game.py @@ -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 -- cgit v0.9.1