Untitled
unknown
plain_text
a year ago
908 B
7
Indexable
import pygame import sys # Initialize Pygame pygame.init() # Set up the display screen_width = 480 screen_height = 320 screen = pygame.display.set_mode((screen_width, screen_height)) pygame.display.set_caption("Two Eyes") # Colors WHITE = (255, 255, 255) BLACK = (0, 0, 0) BLUE = (0, 0, 255) # Eye parameters eye_radius = 50 pupil_radius = 10 # Function to draw an eye def draw_eye(center): pygame.draw.circle(screen,WHITE,center,eye_radius) pygame.draw.circle(screen, BLUE, center, pupil_radius) # Main loop while True: # Handle events for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() # Clear the screen screen.fill(BLACK) # Draw the eyes eye1_center = (180, 160) eye2_center = (300, 160) draw_eye(eye1_center) draw_eye(eye2_center) # Update the display pygame.display.flip()
Editor is loading...
Leave a Comment