| 350 | |
| 351 | |
| 352 | def countdown(): |
| 353 | countdown_font = pygame.font.Font("assets/fonts/turok.ttf", 100) |
| 354 | countdown_texts = ["3", "2", "1", "FIGHT!"] |
| 355 | |
| 356 | for text in countdown_texts: |
| 357 | draw_bg(bg_image, is_game_started=True) |
| 358 | |
| 359 | text_img = countdown_font.render(text, True, RED) |
| 360 | text_width = text_img.get_width() |
| 361 | x_pos = (SCREEN_WIDTH - text_width) // 2 |
| 362 | |
| 363 | draw_text(text, countdown_font, RED, x_pos, SCREEN_HEIGHT // 2 - 50) |
| 364 | |
| 365 | pygame.display.update() |
| 366 | pygame.time.delay(1000) |
| 367 | |
| 368 | |
| 369 | def game_loop(): |