Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- import math
- width = 500
- height = 500
- center_position = (int(witdh/2), int(height/2)) # center of the circle
- radius = 100
- circonference = radius * 2 * math.pi
- # Initialize Pygame
- pygame.init()
- # Set up the game window
- screen = pygame.display.set_mode((width, height))
- pygame.display.set_caption("My Simple Game")
- # Set the background color
- background_color = (255, 255, 255) # white
- screen.fill(background_color)
- # Draw a point
- point_color = (255, 0, 0) # red
- pygame.draw.point(screen, point_color, point_position)
- # Update the screen
- pygame.display.update()
- # Main game loop
- running = True
- while running:
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- running = False
- pygame.display.update()
- # Clean up
- pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement