Skip to content

Instantly share code, notes, and snippets.

@djm4686
Created October 6, 2016 19:09
Show Gist options
  • Save djm4686/b397edaf495584a933f37e9c0b35c74e to your computer and use it in GitHub Desktop.
Save djm4686/b397edaf495584a933f37e9c0b35c74e to your computer and use it in GitHub Desktop.
import pygame
from pygame.locals import *
WIDTH = 1024
HEIGHT = 768
class GameController(object):
def __init__(self):
pygame.init()
self.surface = pygame.display.set_mode((WIDTH, HEIGHT))
def main(self):
while True:
self.event()
self.update()
self.draw()
def event(self):
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
def update(self):
pass
def draw(self):
self.surface.fill((0,0,0))
pygame.display.update()
if __name__ == "__main__":
g = GameController()
g.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment