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:
score_str = file.readline() with open(config.HIGHSCORE_FILE, "r") as file:
file.close() score_str = file.readline()
file.close()
if score_str == "": except IOError:
score_str = "0" return 0
return int(score_str) return int(score_str)