Clears and rewrites the score and high score in the top-left corner.
(self)
| 31 | return 0 |
| 32 | |
| 33 | def update_scoreboard(self): |
| 34 | """Clears and rewrites the score and high score in the top-left corner.""" |
| 35 | self.clear() |
| 36 | self.color(colors.SCORE_COLOR) |
| 37 | # Dynamically calculate position to be well-placed in the header |
| 38 | x_pos = -self.screen.window_width() / 2 + 30 |
| 39 | y_pos = self.screen.window_height() / 2 - 60 |
| 40 | self.goto(x_pos, y_pos) |
| 41 | self.write(f"Score: {self.score} | High Score: {self.high_score}", align=ALIGNMENT, font=SCORE_FONT) |
| 42 | |
| 43 | def increase_score(self): |
| 44 | """Increases score and updates the display.""" |
no test coverage detected