Advertisement
Guest User

pygame_event1.py

a guest
Feb 22nd, 2011
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. import math
  2. import pygame, sys
  3. from pygame.locals import *
  4. pygame.init()
  5. (windows_width, windows_height, windows_title) = (600, 400, "PyGame Event")
  6. screen = pygame.display.set_mode((windows_width,windows_height),0,32)
  7. pygame.display.set_caption(windows_title)
  8. windows_bgcolor = (255,255,255)
  9. mainLoop = True
  10. #initial data here
  11. while mainLoop:
  12.     if pygame.event.peek(QUIT):
  13.         mainLoop = False
  14.     pygame.event.clear()
  15.     screen.fill(windows_bgcolor)
  16.     #create frame here
  17.     pygame.display.update()
  18. pygame.quit()
  19. #destroy data here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement