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