From f68f7385f0c4cc74a576ce9531ce81fe7c09136f Mon Sep 17 00:00:00 2001 From: RomulAugustus <87079566+RomulAugustus@users.noreply.github.com> Date: Mon, 25 Jul 2022 18:16:15 +0300 Subject: [PATCH] Implemented proper time counting --- GameLogic.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GameLogic.py b/GameLogic.py index 853c095..4542005 100644 --- a/GameLogic.py +++ b/GameLogic.py @@ -1,3 +1,5 @@ +from datetime import datetime, time + from GameMap import * from Player import * @@ -9,7 +11,6 @@ class GameLogic(): self.playerList = playerList self.winRowLength = winRowLength self.individualMoves = individualMoves - self.time = 0 # in seconds self.score = 0 self.wait_for_input() @@ -24,11 +25,11 @@ class GameLogic(): pass def get_time(self): - return self.time + return str(datetime.now() - self.startTime) def reset_time(self): - self.time = 0 + self.startTime = datetime.now() def get_score(self):