Player cannot walk if it runs out of stamina

This commit is contained in:
Marcin Kostrzewski 2020-04-06 10:57:44 +02:00
parent 4a33b6e761
commit 6994f39864

View File

@ -22,6 +22,8 @@ class Player(Entity):
# Move in a desired direction
def move(self, rotation):
self.movePoints += 1
# You can only move if you have enough stamina
if self.statistics.stamina > 1:
self.applyWalkingFatigue()
if rotation.value == Rotations.NORTH.value:
self.rect.y -= self.rect.w