Created
October 6, 2016 19:09
-
-
Save djm4686/b397edaf495584a933f37e9c0b35c74e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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