From 2ee1a972d1e1971461e1f7896d5fb3513fab5e6c Mon Sep 17 00:00:00 2001 From: popkex Date: Thu, 25 Jun 2026 14:08:51 +0200 Subject: [PATCH] =?UTF-8?q?am=C3=A9liroation=20de=20la=20fermeture=20du=20?= =?UTF-8?q?jeu=20(plus=20propre)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 33916eb..c454087 100644 --- a/src/main.py +++ b/src/main.py @@ -7,6 +7,7 @@ TODO - ajouter des sons style arcade - faire un highscore (avec la gestion de l'utilisateur et les saves) - faire le systeme de succes + - mettre un easter egg """ import pygame @@ -15,10 +16,11 @@ from game import Game pygame.init() launch_game = True +running = True game = Game() -while True: +while running: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() elif event.type == pygame.KEYDOWN: launch_game = True @@ -26,4 +28,6 @@ while True: if launch_game: launch_game = False game.restart() - if game.run() == -1: pygame.quit() + if game.run() == -1: running = False + +pygame.quit()