1
Fork 0

Added lives for when player gets shot.

This commit is contained in:
Jake Howard 2015-05-07 20:10:16 +01:00
parent e819e2e46d
commit 9e34de19b4

11
game.py
View file

@ -123,6 +123,17 @@ def play(window):
logging.info("Hit Target!") logging.info("Hit Target!")
player.score += 1 player.score += 1
hit_list = pygame.sprite.spritecollide(bullet, player_group, True)
for player in hit_list:
if bullet.type != "TARGET" continue
bullet_group.remove(bullet)
logging.info("")
player.lives -= 1
if player.lives <= 0:
return "LIVES"
if target_movement_timeout <=0: if target_movement_timeout <=0:
drop_targets = False drop_targets = False