adds game
This commit is contained in:
parent
4496ba0811
commit
50e4712545
24 changed files with 528 additions and 0 deletions
17
player_stats.py
Normal file
17
player_stats.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
|
||||
class PlayerStats:
|
||||
def __init__(self):
|
||||
self.lives = 10
|
||||
|
||||
def lose_life(self):
|
||||
self.lives -= 1
|
||||
|
||||
def heal_life(self):
|
||||
if self.lives < 10:
|
||||
self.lives += 1
|
||||
|
||||
def is_dead(self):
|
||||
if self.lives <= 0:
|
||||
return True
|
||||
else:
|
||||
return False
|
Loading…
Add table
Add a link
Reference in a new issue