diff options
-rw-r--r-- | brutalmaze/main.py | 2 | ||||
-rw-r--r-- | brutalmaze/maze.py | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/brutalmaze/main.py b/brutalmaze/main.py index c3db5e9..8aef9a0 100644 --- a/brutalmaze/main.py +++ b/brutalmaze/main.py @@ -47,7 +47,7 @@ def main(): elif event.type == KEYDOWN: if event.key == K_F2: # new game maze.__init__((maze.w, maze.h), fps) - elif event.key in (K_ESCAPE, K_p): + elif event.key in (K_ESCAPE, K_p) and not maze.hero.dead: maze.paused ^= True if not maze.hero.dead: diff --git a/brutalmaze/maze.py b/brutalmaze/maze.py index f9ea6ce..b958299 100644 --- a/brutalmaze/maze.py +++ b/brutalmaze/maze.py @@ -309,9 +309,10 @@ class Maze: self.draw() for enemy in self.enemies: enemy.update() - self.hero.update(fps) - self.slash() - self.track_bullets() + if not self.hero.dead: + self.hero.update(fps) + self.slash() + self.track_bullets() pygame.display.flip() pygame.display.set_caption('Brutal Maze - Score: {}'.format( int(self.score - INIT_SCORE))) |