From f483f62ff5b3549146e2f2ad97960ff35d87b076 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Fri, 26 Jan 2018 20:26:14 +0700 Subject: Stricture losing screen --- brutalmaze/main.py | 2 +- 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))) -- cgit 1.4.1