From 789be9c5d88087b80c62289c2a47d7f6d0684861 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Mon, 30 Apr 2018 20:40:57 +0200 Subject: [PATCH] Refactor code --- main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 43c0066..885856f 100644 --- a/main.py +++ b/main.py @@ -108,8 +108,8 @@ def main(): screen.blit(text, text_rect) pygame.display.flip() - while True: - restart = False + restart = False + while not restart: for event in pygame.event.get(): if event.type == pglocals.QUIT: logger.info('Received QUIT event') @@ -119,8 +119,6 @@ def main(): if event.key == pglocals.K_r: logger.debug('Restarting game') restart = True - if restart: - break clock.tick(5)