Advertisement
albita123

Untitled

Feb 8th, 2023
791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. import pygame
  2. import math
  3.  
  4. width = 500
  5. height = 500
  6. center_position = (int(witdh/2), int(height/2)) # center of the circle
  7. radius =  100
  8. circonference = radius * 2 * math.pi
  9.  
  10. # Initialize Pygame
  11. pygame.init()
  12.  
  13. # Set up the game window
  14. screen = pygame.display.set_mode((width, height))
  15. pygame.display.set_caption("My Simple Game")
  16.  
  17. # Set the background color
  18. background_color = (255, 255, 255) # white
  19. screen.fill(background_color)
  20.  
  21. # Draw a point
  22. point_color = (255, 0, 0) # red
  23.  
  24. pygame.draw.point(screen, point_color, point_position)
  25.  
  26. # Update the screen
  27. pygame.display.update()
  28.  
  29. # Main game loop
  30. running = True
  31. while running:
  32.     for event in pygame.event.get():
  33.         if event.type == pygame.QUIT:
  34.             running = False
  35.     pygame.display.update()
  36.  
  37. # Clean up
  38. pygame.quit()
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement