Skip to content

Instantly share code, notes, and snippets.

@ssherar
Created May 13, 2015 22:18
Show Gist options
  • Save ssherar/603ae87ea65e245d3321 to your computer and use it in GitHub Desktop.
Save ssherar/603ae87ea65e245d3321 to your computer and use it in GitHub Desktop.
1 import os, sys
2 import pygame
3 from pygame.locals import *
4
5 class Game(object):
6
7 def __init__(self, width=640, height=480):
8 pygame.init()
9 self.width = width
10 self.height = height
11
12 self.screen = pygame.display.set_mode((self.width, self.height))
13
14 self.tick()
15
16 def tick(self):
17 while True:
18 for event in pygame.event.get():
19 if event.type == pygame.QUIT:
20 sys.exit()
21
22 if __name__ == "__main__":
23 game = Game()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment