diff options
author | Joshua Minor <j@lux.vu> | 2007-12-15 08:06:12 (GMT) |
---|---|---|
committer | Joshua Minor <j@lux.vu> | 2007-12-15 08:06:12 (GMT) |
commit | f60eebbdd6d4dd18619ad2d8dc6ad9141f9fc3fe (patch) | |
tree | d87a63fecf67b3a92c04fb559f2aa8a4fc69a243 /Maze.activity | |
parent | 5a89304c04d4702d5cbeb20b605a49643568aec5 (diff) |
Official release (v2)
This is what I uploaded to http://wiki.laptop.org/go/Maze
Diffstat (limited to 'Maze.activity')
-rw-r--r-- | Maze.activity/activity/activity-maze.svg | 2 | ||||
-rw-r--r-- | Maze.activity/game.py | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/Maze.activity/activity/activity-maze.svg b/Maze.activity/activity/activity-maze.svg index 23558f4..b612407 100644 --- a/Maze.activity/activity/activity-maze.svg +++ b/Maze.activity/activity/activity-maze.svg @@ -5,7 +5,7 @@ ]>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="50px" height="50px" viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
-<path style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:3.5" d="M49,25H24.497v10.188H12.749L12.75,43H7.001V30H18.75V19.5H31V7.25h12
+<path style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:2.5" d="M49,25H24.497v10.188H12.749L12.75,43H7.001V30H18.75V19.5H31V7.25h12
v6.25h-6v6h12L49.001,1H49H25v0.002V13.5h-6.25V1H1v6h11.75v17H7.001V12.75h-6L1,43v6h17.749v-7.812h5.749L24.497,49h0.001v0.001
L37.562,49v-6h-7.064l-0.002-12h12.505l0.001,18.001h6L49,25z"/>
</svg>
diff --git a/Maze.activity/game.py b/Maze.activity/game.py index 813ce33..3c2216b 100644 --- a/Maze.activity/game.py +++ b/Maze.activity/game.py @@ -84,6 +84,7 @@ class MazeGame: self.start_time = int(time.time()) self.maze = Maze(self.start_time, int(9*self.aspectRatio), 9) self.reset() + self.frame = 0 def reset(self): """Reset the game state. Everyone starts in the top-left. @@ -219,9 +220,10 @@ class MazeGame: # lets draw once before we enter the event loop self.draw() pygame.display.flip() - clock = pygame.time.Clock() + #clock = pygame.time.Clock() while self.running: + self.frame += 1 # is there anything to animate? movement = False for player in self.players.values(): @@ -240,9 +242,10 @@ class MazeGame: self.draw() pygame.display.flip() - # don't animate faster than 12 frames per second + # don't animate faster than about 20 frames per second # this keeps the speed reasonable and limits cpu usage - clock.tick(12) + pygame.time.wait(1000/20) + #clock.tick(20) doesn't play nice when we use pygame.event.wait() def harder(self): """Make a new maze that is harder than the current one.""" @@ -324,7 +327,9 @@ class MazeGame: pygame.draw.rect(self.screen, self.GOAL_COLOR, rect, 0) # draw all remote players - for player in self.players.values(): + remotePlayers = list(self.players.values()) + remotePlayers.remove(self.localplayer) + for player in remotePlayers: self.drawPlayer(player) # draw the local player last so he/she will show up on top |