Player cannot rotate dead

This commit is contained in:
Marcin Kostrzewski 2020-04-06 11:55:56 +02:00
parent a275678e3f
commit f1232956a0

View File

@ -85,6 +85,7 @@ class Player(Entity):
return self.statistics return self.statistics
def rotate(self, rotation): def rotate(self, rotation):
if self.alive:
# If the player is not facing given direction, it will not move the first time, it will only get rotated # If the player is not facing given direction, it will not move the first time, it will only get rotated
if self.rotation.value != rotation.value: if self.rotation.value != rotation.value:
self.image = pygame.transform.rotate(self.image, ((self.rotation.value - rotation.value) * 90)) self.image = pygame.transform.rotate(self.image, ((self.rotation.value - rotation.value) * 90))