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 = 800 height = 800 screen = pygame.display.set_mode((width,height)) def run_game(): # number of rows and columns in your grid rows = 30 cols = 30 # some variables to help with drawing the grid cell_width = 20 x_offset = 20 y_offset = 20 padding = 3 # 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()