Untitled
unknown
plain_text
a year ago
701 B
3
Indexable
import pygame import sys # Initialize Pygame pygame.init() # Constants WIDTH, HEIGHT = 800, 600 WHITE = (255, 255, 255) BLUE = (0, 0, 255) EARTH_RADIUS = 100 # Create the display surface screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("Earth") # Main game loop running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False # Clear the screen screen.fill(WHITE) # Draw the Earth pygame.draw.circle(screen, BLUE, (WIDTH // 2, HEIGHT // 2), EARTH_RADIUS) # Update the display pygame.display.flip() # Quit Pygame pygame.quit() sys.exit()
Editor is loading...