Changed alive checking
This commit is contained in:
parent
b22e69712c
commit
deec08cec7
@ -1,3 +1,5 @@
|
||||
from time import sleep
|
||||
|
||||
import pygame
|
||||
|
||||
from src.entities.Interactable import Interactable
|
||||
@ -32,6 +34,7 @@ class EventManager:
|
||||
self.game.screen.ui.updateBasedOnPygameEvent(event)
|
||||
self.keyTimeout += self.keyTimer.tick()
|
||||
if self.keyTimeout >= TIMEOUT:
|
||||
if self.player.alive:
|
||||
self.handlePlayerControls(keys)
|
||||
self.keyTimeout = 0
|
||||
|
||||
@ -41,7 +44,6 @@ class EventManager:
|
||||
# Key names are temporary
|
||||
# TODO: Load key bindings from JSON
|
||||
|
||||
if self.player.alive:
|
||||
# Picking up items
|
||||
if keys[pygame.K_SPACE]:
|
||||
object = self.game.map.getEntityOnCoord(self.player.getFacingCoord())
|
||||
|
Loading…
Reference in New Issue
Block a user