import pygame pygame.init() screen = pygame.display.set_mode((640, 480)) pygame.display.set_caption("Click Score") clock = pygame.time.Clock() BG = (15, 30, 50) WHITE = (255, 255, 255) font = pygame.font.SysFont(None, 56) score = 0 running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False elif event.type == pygame.MOUSEBUTTONDOWN: score += 1 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()