import pygame def run_game(): ## Initialize the pygame submodules and set up the display window. pygame.init() width = 640 height = 480 game_window = pygame.display.set_mode((width,height)) one_guy_pic = pygame.image.load("WalkingSquare1.gif") one_guy_pic = one_guy_pic.convert() guy_x = 100 guy_y = 100 ## The game loop starts here. keepGoing = True while (keepGoing): ## Handle events. for event in pygame.event.get(): if event.type == pygame.QUIT: keepGoing = False ## Draw picture and update display game_window.fill(pygame.color.Color("yellowgreen")) game_window.blit(one_guy_pic,(guy_x,guy_y)) pygame.display.update() ## The game loop ends here. pygame.quit() ## Call the function run_game. run_game()