Update Game_V2.py
parent
54404cac31
commit
13e6d6777b
|
@ -1,6 +1,7 @@
|
||||||
import pygame
|
import pygame
|
||||||
from random import randint
|
from random import randint
|
||||||
import math
|
import math
|
||||||
|
import sys
|
||||||
|
|
||||||
SCREEN_X = 1280
|
SCREEN_X = 1280
|
||||||
SCREEN_Y = 720
|
SCREEN_Y = 720
|
||||||
|
@ -61,6 +62,7 @@ class Player(pygame.sprite.Sprite):
|
||||||
def get_health(self, amnount):
|
def get_health(self, amnount):
|
||||||
if self.target_health < self.maximum_health:
|
if self.target_health < self.maximum_health:
|
||||||
self.target_health += amnount
|
self.target_health += amnount
|
||||||
|
pygame.mixer.Sound("Sounds/health_plus.mp3")
|
||||||
if self.target_health >= self.maximum_health:
|
if self.target_health >= self.maximum_health:
|
||||||
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.target_health = player.maximum_health
|
||||||
player.SCORE = 0
|
player.SCORE = 0
|
||||||
if keys[pygame.K_q]:
|
if keys[pygame.K_q]:
|
||||||
running = False
|
pygame.quit()
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
else: # If player is alive, continue the game
|
else: # If player is alive, continue the game
|
||||||
screen.fill("cyan")
|
screen.fill("cyan")
|
||||||
|
|
Loading…
Reference in New Issue