tunnel-tunnel/player_stats.py

17 lines
314 B
Python
Raw Permalink Normal View History

2024-12-01 16:37:27 +00:00
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