hihi
This commit is contained in:
@@ -31,12 +31,12 @@ class GameFactory:
|
|||||||
PLAYER_LAMPS.activateNext()
|
PLAYER_LAMPS.activateNext()
|
||||||
|
|
||||||
def getHighScore(self):
|
def getHighScore(self):
|
||||||
with open(config.HIGHSCORE_FILE, "w+") as file:
|
try:
|
||||||
|
with open(config.HIGHSCORE_FILE, "r") as file:
|
||||||
score_str = file.readline()
|
score_str = file.readline()
|
||||||
file.close()
|
file.close()
|
||||||
|
except IOError:
|
||||||
if score_str == "":
|
return 0
|
||||||
score_str = "0"
|
|
||||||
|
|
||||||
return int(score_str)
|
return int(score_str)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user