Advertisement
noTformaT

pygame_template.py Time Based

Mar 6th, 2011
738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 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, "Simple Figure")
  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. clock = pygame.time.Clock()
  11. milli = seconds = 0.0
  12. #initial data here
  13. while mainLoop:
  14.     for event in pygame.event.get():
  15.         if event.type == QUIT:
  16.             mainLoop = False
  17.     screen.fill(windows_bgcolor)
  18.     #calc time
  19.     milli = clock.tick()
  20.     seconds = milli / 1000.0
  21.     #create frame here
  22.     pygame.display.update()
  23. pygame.quit()
  24. #destroy data here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement