import pygame pygame.init() screen = pygame.display.set_mode((640, 480)) pygame.display.set_caption("Score Display") clock = pygame.time.Clock() BG = (20, 20, 20) WHITE = (255, 255, 255) font = pygame.font.SysFont(None, 48) score = 0 running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False screen.fill(BG) score_surf = font.render(f"Score: {score}", True, WHITE) screen.blit(score_surf, (20, 20)) pygame.display.flip() clock.tick(60) pygame.quit()