This commit is contained in:
Jonas Zeunert
2022-09-01 02:01:46 +02:00
parent ce8d374e57
commit 6cd20e34f4

View File

@@ -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)