From 13e6d6777b082e51a3e1990c0d9fbd82bd573eae Mon Sep 17 00:00:00 2001 From: Gerhards Kristians Tillers Date: Mon, 4 Mar 2024 07:30:53 +0000 Subject: [PATCH] Update Game_V2.py --- Game_V2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Game_V2.py b/Game_V2.py index 0d9656f..76db865 100644 --- a/Game_V2.py +++ b/Game_V2.py @@ -1,6 +1,7 @@ import pygame from random import randint import math +import sys SCREEN_X = 1280 SCREEN_Y = 720 @@ -61,6 +62,7 @@ class Player(pygame.sprite.Sprite): def get_health(self, amnount): if self.target_health < self.maximum_health: self.target_health += amnount + pygame.mixer.Sound("Sounds/health_plus.mp3") if self.target_health >= self.maximum_health: self.target_health = self.maximum_health @@ -411,7 +413,8 @@ while running: player.target_health = player.maximum_health player.SCORE = 0 if keys[pygame.K_q]: - running = False + pygame.quit() + sys.exit() else: # If player is alive, continue the game screen.fill("cyan")