Add passing events, stats to update Ui when handling events
This commit is contained in:
parent
0fb5f925d2
commit
17125f9dd9
@ -25,11 +25,14 @@ class EventManager:
|
|||||||
for event in pygame.event.get():
|
for event in pygame.event.get():
|
||||||
if event.type == pygame.QUIT:
|
if event.type == pygame.QUIT:
|
||||||
self.game.running = False
|
self.game.running = False
|
||||||
|
self.game.screen.ui.updateBasedOnPygameEvent(event)
|
||||||
self.keyTimeout += self.keyTimer.tick()
|
self.keyTimeout += self.keyTimer.tick()
|
||||||
if self.keyTimeout >= TIMEOUT:
|
if self.keyTimeout >= TIMEOUT:
|
||||||
self.handlePlayerControls(keys)
|
self.handlePlayerControls(keys)
|
||||||
self.keyTimeout = 0
|
self.keyTimeout = 0
|
||||||
|
|
||||||
|
self.game.screen.ui.updateBasedOnPlayerStats(self.player.statistics)
|
||||||
|
|
||||||
def handlePlayerControls(self, keys):
|
def handlePlayerControls(self, keys):
|
||||||
# Key names are temporary
|
# Key names are temporary
|
||||||
# TODO: Load key bindings from JSON
|
# TODO: Load key bindings from JSON
|
||||||
|
Loading…
Reference in New Issue
Block a user