about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorNguyễn Gia Phong <vn.mcsinyx@gmail.com>2018-01-26 20:26:14 +0700
committerNguyễn Gia Phong <vn.mcsinyx@gmail.com>2018-01-26 20:26:14 +0700
commitf483f62ff5b3549146e2f2ad97960ff35d87b076 (patch)
tree64ed5556ee65f2e74f7adfb9c0a3997a20f605be
parent097357347c968adbf636f37e49f3ddf4c68ba5bc (diff)
downloadbrutalmaze-f483f62ff5b3549146e2f2ad97960ff35d87b076.tar.gz
Stricture losing screen
-rw-r--r--brutalmaze/main.py2
-rw-r--r--brutalmaze/maze.py7
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)))