MCPcopy Index your code
hub / github.com/geekcomputers/Python / countdown

Function countdown

Street_Fighter/src/main.py:352–366  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

350
351
352def 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
369def game_loop():

Callers 1

game_loopFunction · 0.85

Calls 3

draw_bgFunction · 0.85
draw_textFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected