Advertisement
snowden_web

Untitled

Aug 8th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | None | 0 0
  1. import pygame
  2.  
  3. # Define some colors
  4. BLACK = (0, 0, 0)
  5. WHITE = (255, 255, 255)
  6. GREEN = (0, 255, 0)
  7. RED = (255, 0, 0)
  8.  
  9. pygame.init()
  10.  
  11. # Set the width and height of the screen [width, height]
  12. size = (700, 500)
  13. screen = pygame.display.set_mode(size)
  14.  
  15. pygame.display.set_caption("My Game")
  16.  
  17. # Loop until the user clicks the close button.
  18. done = False
  19.  
  20. # Used to manage how fast the screen updates
  21. clock = pygame.time.Clock()
  22.  
  23. # Main Program Loop
  24. while not done:
  25.     # Main event loop
  26.     for event in pygame.event.get():
  27.         if event.type == pygame.QUIT:
  28.             done = True
  29.  
  30.     # background image.
  31.     screen.fill(WHITE)
  32.  
  33.     # --- Go ahead and update the screen with what we've drawn.
  34.     pygame.display.flip()
  35.  
  36.     # --- Limit to 60 frames per second
  37.     clock.tick(60)
  38.  
  39. # Close the window and quit.
  40. pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement