Catapults working. At this point most of the basic game is set up, now I have to get down to level and enemy creation, and sounds for when things happen.
This commit is contained in:
@@ -12,6 +12,7 @@ class Player:
|
||||
|
||||
# Stats and tracking
|
||||
self._health = 10
|
||||
self._maxHealth = 10
|
||||
self._lives = 1
|
||||
self.distanceSinceLastStep = 0
|
||||
self.stepDistance = 0.5
|
||||
@@ -92,6 +93,10 @@ class Player:
|
||||
"""Get current health"""
|
||||
return self._health
|
||||
|
||||
def get_max_health(self):
|
||||
"""Get current max health"""
|
||||
return self._maxHealth
|
||||
|
||||
def set_health(self, value):
|
||||
"""Set health and handle death if needed"""
|
||||
if self.isInvincible:
|
||||
@@ -103,6 +108,10 @@ class Player:
|
||||
if self._lives > 0:
|
||||
self._health = 10 # Reset health if we still have lives
|
||||
|
||||
def set_max_health(self, value):
|
||||
"""Set max health"""
|
||||
self._maxHealth = value
|
||||
|
||||
def get_coins(self):
|
||||
"""Get remaining coins"""
|
||||
return self._coins
|
||||
|
Reference in New Issue
Block a user