Skip to content

Commit

Permalink
fixed highscore system
Browse files Browse the repository at this point in the history
  • Loading branch information
PK-cod3ch3mist committed Nov 29, 2023
1 parent 0d3d6b0 commit 75d67d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ def write_to_file(score: int):
highscores.sort(reverse=True)
# open the file in write mode
highscores_file = open("./assets/scores/highscores.txt", "w")
# write the scores to the file
# write the top 3 scores to the file
i = 1
for score in highscores:
highscores_file.write(str(score) + "\n")
i += 1
if i > 3:
break
# close the file
highscores_file.close()

Expand Down

0 comments on commit 75d67d8

Please sign in to comment.