import pygame import random 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 = 600 height = 600 screen = pygame.display.set_mode((width,height)) def run_game(): # DEFINE GRID HERE cell_width = 50 x_offset = 20 y_offset = 20 padding = 5 # start clock 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 # set background color screen.fill(pygame.color.Color("navy")) # update display pygame.display.update() def done(): pygame.quit() def main(): initialize() run_game() done() main()