From f1232956a0ec6531501f1fbbd29953bae8928a20 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Mon, 6 Apr 2020 11:55:56 +0200 Subject: [PATCH] Player cannot rotate dead --- src/entities/Player.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/entities/Player.py b/src/entities/Player.py index 1a2d160..ffcbfd4 100644 --- a/src/entities/Player.py +++ b/src/entities/Player.py @@ -85,10 +85,11 @@ class Player(Entity): return self.statistics 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.rotation.value != rotation.value: - self.image = pygame.transform.rotate(self.image, ((self.rotation.value - rotation.value) * 90)) - self.rotation = 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 self.rotation.value != rotation.value: + 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 def determineLife(self):