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

Function scores_screen

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

Source from the content-addressed store, hash-verified

257
258
259def scores_screen():
260 while True:
261 draw_bg(bg_image)
262
263 scores_title = "SCORES"
264 draw_text(
265 scores_title,
266 menu_font_title,
267 RED,
268 SCREEN_WIDTH // 2 - menu_font_title.size(scores_title)[0] // 2,
269 50,
270 )
271
272 score_font_large = pygame.font.Font(
273 "assets/fonts/turok.ttf", 60
274 ) # Increased size for scores
275 p1_text = f"P1: {score[0]}"
276 p2_text = f"P2: {score[1]}"
277 shadow_offset = 5
278
279 p1_text_x = SCREEN_WIDTH // 2 - score_font_large.size(p1_text)[0] // 2
280 p1_text_y = SCREEN_HEIGHT // 2 - 50
281 draw_text(
282 p1_text,
283 score_font_large,
284 BLACK,
285 p1_text_x + shadow_offset,
286 p1_text_y + shadow_offset,
287 ) # Shadow
288 draw_gradient_text(
289 p1_text, score_font_large, p1_text_x, p1_text_y, [BLUE, GREEN]
290 ) # Gradient
291
292 p2_text_x = SCREEN_WIDTH // 2 - score_font_large.size(p2_text)[0] // 2
293 p2_text_y = SCREEN_HEIGHT // 2 + 50
294 draw_text(
295 p2_text,
296 score_font_large,
297 BLACK,
298 p2_text_x + shadow_offset,
299 p2_text_y + shadow_offset,
300 ) # Shadow
301 draw_gradient_text(
302 p2_text, score_font_large, p2_text_x, p2_text_y, [RED, YELLOW]
303 ) # Gradient
304
305 return_button = draw_button(
306 "RETURN TO MAIN MENU",
307 menu_font,
308 BLACK,
309 GREEN,
310 SCREEN_WIDTH // 2 - 220,
311 700,
312 500,
313 50,
314 )
315
316 for event in pygame.event.get():

Callers 1

main.pyFile · 0.85

Calls 8

draw_bgFunction · 0.85
draw_textFunction · 0.85
draw_gradient_textFunction · 0.85
draw_buttonFunction · 0.85
exitFunction · 0.85
sizeMethod · 0.80
getMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected