""" by Kristina Striegnitz May 12, 2009 """ import pygame def initialize(): """ This function sets some global constants (i.e., the values of these global variables never change). """ pygame.init() # set up the display window global width, height, screen width = 800 height = 800 screen = pygame.display.set_mode((width,height)) def run_game(): clock = pygame.time.Clock() keepGoing = True while (keepGoing): dt = clock.tick() # go through all events that happened and check ... for event in pygame.event.get(): # ... whether the event was a quit event if event.type == pygame.QUIT: keepGoing = False screen.fill(pygame.color.Color("navy")) pygame.display.update() def done(): pygame.quit() def main(): initialize() run_game() done() main()