Add updating ui bars and updating console on interaction in EventManager

This commit is contained in:
Michał Czekański 2020-04-06 13:20:28 +02:00
parent 178115cc4d
commit b22e69712c

View File

@ -35,6 +35,8 @@ class EventManager:
self.handlePlayerControls(keys)
self.keyTimeout = 0
self.game.screen.ui.updateBarsBasedOnPlayerStats(self.player.statistics)
def handlePlayerControls(self, keys):
# Key names are temporary
# TODO: Load key bindings from JSON
@ -50,6 +52,7 @@ class EventManager:
self.game.map.removeSpriteFromMap(object)
elif type(object) is Interactable:
object.on_interaction(self.player)
self.game.screen.ui.updateOnPlayerInteraction(self.player.statistics, object)
# Movement
if keys[pygame.K_w]: