Allow to quit again, keep the score after the game is over.

master
Raphaël Vinot 2014-08-30 22:13:53 +02:00
parent c1f1c85d45
commit dd49ec5b5c
1 changed files with 5 additions and 1 deletions

View File

@ -68,12 +68,16 @@ def main():
timeleft -= time_passed / 1000 timeleft -= time_passed / 1000
timeleft = round(timeleft, 2) timeleft = round(timeleft, 2)
if timeleft <= 0: if timeleft <= 0:
screen_width, screen_height = size screen_width, screen_height = size
screen.blit(game_over, (screen_width/3, screen_height/2)) screen.blit(game_over, (screen_width/3, screen_height/2))
displaytime = 'Timed out!' displaytime = 'Timed out!'
# Redraw the HUD
the_hud.draw_hud(score, displaytime, round(fps, 2))
pygame.display.flip() pygame.display.flip()
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
continue continue
else: else:
displaytime = timeleft displaytime = timeleft