Document 12a
Document 12a
Import sys
# Initialize Pygame
Pygame.init()
# Set up display
# Define colors
BLACK = (0, 0, 0)
RED = (255, 0, 0)
# Ball properties
Ball_radius = 20
Running = True
While running:
# Handle events
If event.type == pygame.QUIT:
Running = False
Ball_x += ball_speed_x
Ball_y += ball_speed_y
Screen.fill(BLACK)
Pygame.display.flip()
Pygame.time.Clock().tick(60)
# Quit Pygame
Pygame.quit()
Sys.exit()