Skip to content

Instantly share code, notes, and snippets.

@djm4686
Created December 6, 2016 19:42
Show Gist options
  • Save djm4686/89a8dfb09d7485cec3028289d680209d to your computer and use it in GitHub Desktop.
Save djm4686/89a8dfb09d7485cec3028289d680209d to your computer and use it in GitHub Desktop.
import pygame
from pygame.locals import *
class GameController:
def __init__(self, width, height):
pygame.init()
self.width = width
self.height = height
self.running = True
self.surface = pygame.set_mode((width, height))
# THIS IS WHERE YOU'D CREATE THE MAP
# from map_module import Map
# self.map = Map(rows, cols)
self.main()
def main(self):
while self.running:
self.event()
self.update()
self.draw()
def update(self):
pass
def event(self):
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
# else:
# self.map.handle_event(event)
def draw(self):
# self.map.draw(self.surface)
pass
if __name__ == "__main__":
gc = GameController(800, 600)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment