Checks for new high score, saves it, and resets the score.
(self)
| 46 | self.update_scoreboard() |
| 47 | |
| 48 | def reset(self): |
| 49 | """Checks for new high score, saves it, and resets the score.""" |
| 50 | if self.score > self.high_score: |
| 51 | self.high_score = self.score |
| 52 | with open("highscore.txt", mode="w") as file: |
| 53 | file.write(str(self.high_score)) |
| 54 | self.score = 0 |
| 55 | self.update_scoreboard() |
| 56 | |
| 57 | def game_over(self): |
| 58 | """Displays the Game Over message and instructions.""" |
nothing calls this directly
no test coverage detected