Implemented proper time counting
This commit is contained in:
parent
97957238fb
commit
f68f7385f0
@ -1,3 +1,5 @@
|
|||||||
|
from datetime import datetime, time
|
||||||
|
|
||||||
from GameMap import *
|
from GameMap import *
|
||||||
from Player import *
|
from Player import *
|
||||||
|
|
||||||
@ -9,7 +11,6 @@ class GameLogic():
|
|||||||
self.playerList = playerList
|
self.playerList = playerList
|
||||||
self.winRowLength = winRowLength
|
self.winRowLength = winRowLength
|
||||||
self.individualMoves = individualMoves
|
self.individualMoves = individualMoves
|
||||||
self.time = 0 # in seconds
|
|
||||||
self.score = 0
|
self.score = 0
|
||||||
|
|
||||||
self.wait_for_input()
|
self.wait_for_input()
|
||||||
@ -24,11 +25,11 @@ class GameLogic():
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def get_time(self):
|
def get_time(self):
|
||||||
return self.time
|
return str(datetime.now() - self.startTime)
|
||||||
|
|
||||||
|
|
||||||
def reset_time(self):
|
def reset_time(self):
|
||||||
self.time = 0
|
self.startTime = datetime.now()
|
||||||
|
|
||||||
|
|
||||||
def get_score(self):
|
def get_score(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user