import pygame WIDTH, HEIGHT = 640, 480 pygame.init() screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("Hello, Pygame") clock = pygame.time.Clock() font = pygame.font.Font(None, 48) # None = Pygame's built-in font running = True while running: # 1. Handle events for event in pygame.event.get(): if event.type == pygame.QUIT: running = False # 2. Update the game (nothing moves yet) # 3. Draw the frame screen.fill("cornflowerblue") pygame.draw.circle(screen, "gold", (WIDTH // 2, HEIGHT // 2 - 40), 50) text = font.render("Hello, Pygame!", True, "white") screen.blit(text, text.get_rect(center=(WIDTH // 2, HEIGHT // 2 + 60))) pygame.display.flip() clock.tick(60) # at most 60 frames per second pygame.quit()