import pygame def initialize(): """ This function sets some global constants. """ 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(): # initialize the balloon's position and speed b_x = 100 b_y = 100 b_speed_x = 0.2 b_speed_y = 0.2 # initialize the score score = 0 # start clock clock = pygame.time.Clock() keepGoing = True while (keepGoing): dt = clock.tick() for event in pygame.event.get(): if event.type == pygame.QUIT: keepGoing = False screen.fill(pygame.color.Color("darkblue")) # calculate the new position and speed of the balloon pygame.draw.circle(screen,pygame.color.Color("orange"),(width/2,height/2),(height-10)/2) # update display pygame.display.update() def quit(): pygame.quit() def main(): initialize() run_game() quit() main()