import pygame # Homework: display a score on screen using pygame text. # 1. Create a font object with pygame.font.SysFont(None, 48). # 2. Create a score variable starting at 0. # 3. Each frame, render a string like "Score: 0" and blit it near the top-left. # Hint: f"Score: {score}" builds the string. # font.render(text, True, color) builds the surface. # screen.blit(surface, (x, y)) draws it. 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) # TODO: create a font object # TODO: create a score variable running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False screen.fill(BG) # TODO: render the score string and blit it to the screen pygame.display.flip() clock.tick(60) pygame.quit()