From dd49ec5b5c977125779b2dfb11260fef425a81b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Sat, 30 Aug 2014 22:13:53 +0200 Subject: [PATCH] Allow to quit again, keep the score after the game is over. --- game.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/game.py b/game.py index 5470c36..476cd48 100755 --- a/game.py +++ b/game.py @@ -68,12 +68,16 @@ def main(): timeleft -= time_passed / 1000 timeleft = round(timeleft, 2) - if timeleft <= 0: screen_width, screen_height = size screen.blit(game_over, (screen_width/3, screen_height/2)) displaytime = 'Timed out!' + # Redraw the HUD + the_hud.draw_hud(score, displaytime, round(fps, 2)) pygame.display.flip() + for event in pygame.event.get(): + if event.type == pygame.QUIT: + running = False continue else: displaytime = timeleft