| 108 | pygame.mixer.Sound.play(score_sound) |
| 109 | |
| 110 | def restart_counter(self): |
| 111 | current_time = pygame.time.get_ticks() |
| 112 | countdown_number = 3 |
| 113 | |
| 114 | if current_time - self.score_time <= 700: |
| 115 | countdown_number = 3 |
| 116 | if 700 < current_time - self.score_time <= 1400: |
| 117 | countdown_number = 2 |
| 118 | if 1400 < current_time - self.score_time <= 2100: |
| 119 | countdown_number = 1 |
| 120 | if current_time - self.score_time >= 2100: |
| 121 | self.active = True |
| 122 | |
| 123 | time_counter = game_font.render(str(countdown_number), True, accent_color) |
| 124 | time_counter_rect = time_counter.get_rect(center=(WIDTH / 2, HEIGHT / 2 + 50)) |
| 125 | pygame.draw.rect(WIN, bg_color, time_counter_rect) |
| 126 | WIN.blit(time_counter, time_counter_rect) |
| 127 | |
| 128 | |
| 129 | class Game_Manager: |