MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / score_display

Function score_display

projects/Flappybird_game/main.py:54–69  ·  view source on GitHub ↗
(game_state)

Source from the content-addressed store, hash-verified

52
53
54def 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
72def update_score(score, high_score):

Callers 1

main.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected