Advertisement
sufokmpc

pygame simple skeleton

Apr 11th, 2012
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. #
  2. # pygame simple skeleton
  3. # xorc1zt
  4. # 2012
  5. #
  6.  
  7. import pygame, sys,os
  8.  
  9. class Game():
  10.     def __init__(self):
  11.         pygame.init()
  12.         self.window = pygame.display.set_mode((800, 600))
  13.         self.screen = pygame.display.get_surface()
  14.         pygame.display.set_caption('GAME TITLE')
  15.  
  16.     def MainLoop(self):
  17.         self.running = True
  18.  
  19.         while self.running:
  20.             self.Events()
  21.             self.Update()
  22.             self.Render()
  23.  
  24.         self.Quit()
  25.  
  26.     def Quit(self):
  27.         sys.exit(0)
  28.  
  29.     def Update(self):
  30.         pass
  31.  
  32.     def Render(self):
  33.         pygame.display.flip()
  34.  
  35.     def Events(self):
  36.         for event in pygame.event.get():
  37.             if event.type == pygame.QUIT:
  38.                 self.running = False
  39.  
  40. if __name__=="__main__":
  41.     gameins = Game()
  42.     gameins.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement