Merge branch 'writingInfoToConsole' of https://git.wmi.amu.edu.pl/s444409/DSZI_Survival into writingInfoToConsole

This commit is contained in:
Michał Czekański 2020-04-06 13:44:39 +02:00
commit 2893b4dd2c

View File

@ -1,3 +1,5 @@
from time import sleep
import pygame import pygame
from src.entities.Interactable import Interactable from src.entities.Interactable import Interactable
@ -32,6 +34,7 @@ class EventManager:
self.game.screen.ui.updateBasedOnPygameEvent(event) self.game.screen.ui.updateBasedOnPygameEvent(event)
self.keyTimeout += self.keyTimer.tick() self.keyTimeout += self.keyTimer.tick()
if self.keyTimeout >= TIMEOUT: if self.keyTimeout >= TIMEOUT:
if self.player.alive:
self.handlePlayerControls(keys) self.handlePlayerControls(keys)
self.keyTimeout = 0 self.keyTimeout = 0
@ -41,7 +44,6 @@ 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())