Events won't be handled if the player is dead
This commit is contained in:
parent
605bf55ebf
commit
e3b3fdd74f
@ -85,7 +85,6 @@ 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))
|
||||||
|
@ -41,6 +41,7 @@ class EventManager:
|
|||||||
# Key names are temporary
|
# Key names are temporary
|
||||||
# TODO: Load key bindings from JSON
|
# TODO: Load key bindings from JSON
|
||||||
|
|
||||||
|
if self.player.alive:
|
||||||
# Picking up items
|
# Picking up items
|
||||||
if keys[pygame.K_SPACE]:
|
if keys[pygame.K_SPACE]:
|
||||||
object = self.game.map.getEntityOnCoord(self.player.getFacingCoord())
|
object = self.game.map.getEntityOnCoord(self.player.getFacingCoord())
|
||||||
|
Loading…
Reference in New Issue
Block a user