Player cannot rotate dead
This commit is contained in:
parent
a275678e3f
commit
f1232956a0
@ -85,10 +85,11 @@ class Player(Entity):
|
|||||||
return self.statistics
|
return self.statistics
|
||||||
|
|
||||||
def rotate(self, rotation):
|
def rotate(self, rotation):
|
||||||
# If the player is not facing given direction, it will not move the first time, it will only get rotated
|
if self.alive:
|
||||||
if self.rotation.value != rotation.value:
|
# If the player is not facing given direction, it will not move the first time, it will only get rotated
|
||||||
self.image = pygame.transform.rotate(self.image, ((self.rotation.value - rotation.value) * 90))
|
if self.rotation.value != rotation.value:
|
||||||
self.rotation = rotation
|
self.image = pygame.transform.rotate(self.image, ((self.rotation.value - rotation.value) * 90))
|
||||||
|
self.rotation = rotation
|
||||||
|
|
||||||
# Updates self.alive if any of the statistic reaches critical value
|
# Updates self.alive if any of the statistic reaches critical value
|
||||||
def determineLife(self):
|
def determineLife(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user