From 86d9efe8376761af813006f4a4882f3c8b87bf38 Mon Sep 17 00:00:00 2001 From: jonspacz Date: Sun, 5 Apr 2020 23:43:23 +0200 Subject: [PATCH] Merge branch 'passingEvents' of C:\Users\Paul\Desktop\DSZI_Survival with conflicts. --- src/game/Game.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/game/Game.py b/src/game/Game.py index ed1f267..86e1643 100644 --- a/src/game/Game.py +++ b/src/game/Game.py @@ -6,8 +6,10 @@ from os import path from game.EventManager import EventManager from game.Screen import Screen from game.Map import Map + +from src.entities.Pickupable import Pickupable from src.entities.Player import Player -from src.game.Timer import Timer +from src.entities.Statistics import Statistics class Game: @@ -38,11 +40,6 @@ class Game: print("The screen cannot be in a vertical orientation. Exiting...") exit(1) - # Initialize timers - self.pgTimer = pygame.time.Clock() - self.ingameTimer = Timer() - self.ingameTimer.startClock() - self.screen = Screen(self, self.config["window"]) print("OK") @@ -52,13 +49,11 @@ class Game: self.map.addEntity(self.player) self.eventManager = EventManager(self, self.player) + self.mainLoop() def mainLoop(self): while self.running: - # Update ingame clock - self.ingameTimer.updateTime(self.pgTimer.tick()) - self.eventManager.handleEvents() self.spritesList.draw(self.screen.pygameScreen) pygame.display.flip()