| 52 | |
| 53 | |
| 54 | def score_display(game_state): |
| 55 | if game_state == " main_game": |
| 56 | score_surface = game_font.render(str(int(score)), True, (255, 255, 255)) |
| 57 | score_rect = score_surface.get_rect(center=(288 / 2, 50)) |
| 58 | screen.blit(score_surface, score_rect) |
| 59 | |
| 60 | if game_state == "game_over": |
| 61 | score_surface = game_font.render(f"Score:{int(score)}", True, (255, 255, 255)) |
| 62 | score_rect = score_surface.get_rect(center=(288 / 2, 50)) |
| 63 | screen.blit(score_surface, score_rect) |
| 64 | |
| 65 | high_score_surface = game_font.render( |
| 66 | f" High Score:{int(high_score)}", True, (255, 255, 255) |
| 67 | ) |
| 68 | high_score_rect = high_score_surface.get_rect(center=(288 / 2, 410)) |
| 69 | screen.blit(high_score_surface, high_score_rect) |
| 70 | |
| 71 | |
| 72 | def update_score(score, high_score): |