This commit is contained in:
Marcin Kostrzewski 2020-05-10 14:25:30 +02:00
parent f104e90a0f
commit 16bb2cd311

View File

@ -1,14 +1,14 @@
import pygame
import json import json
from pathlib import Path
from os import path from os import path
from pathlib import Path
import pygame
from src.AI.AutomaticMovement import AutomaticMovement from src.AI.AutomaticMovement import AutomaticMovement
from src.game.EventManager import EventManager
from src.game.Screen import Screen, Locations
from src.game.Map import Map
from src.entities.Player import Player from src.entities.Player import Player
from src.game.EventManager import EventManager
from src.game.Map import Map
from src.game.Screen import Screen, Locations
from src.game.Timer import Timer from src.game.Timer import Timer
@ -42,7 +42,6 @@ class Game:
print("The screen cannot be in a vertical orientation. Exiting...") print("The screen cannot be in a vertical orientation. Exiting...")
exit(1) exit(1)
# Initialize timers # Initialize timers
# PyGame timer - precise timer, counts milliseconds every frame # PyGame timer - precise timer, counts milliseconds every frame
self.pgTimer = pygame.time.Clock() self.pgTimer = pygame.time.Clock()
@ -54,9 +53,6 @@ class Game:
self.screen = Screen(self, self.config["window"]) self.screen = Screen(self, self.config["window"])
print("OK") print("OK")
self.deltaTime = 0
self.lastTimePassed = self.ingameTimer.timePassed
self.moveTimer = 0 self.moveTimer = 0
self.moveTime = 100 self.moveTime = 100
@ -93,9 +89,6 @@ class Game:
# Tick the timers # Tick the timers
self.ingameTimer.updateTime(self.pgTimer.tick()) self.ingameTimer.updateTime(self.pgTimer.tick())
self.deltaTime = self.ingameTimer.timePassed - self.lastTimePassed
self.lastTimePassed = self.ingameTimer.timePassed
# Handle all events # Handle all events
self.eventManager.handleEvents() self.eventManager.handleEvents()