import pygame
 
# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
BROWN = (150,75,0)

#define your functions after the imports and global vars
class Ball():
    def __init__(self):
        # --- Class Attributes ---
        # Ball position
        self.x = 0
        self.y = 0
 
        # Ball's vector
        self.change_x = 0
        self.change_y = 0
 
        # Ball size
        self.size = 10
 
        # Ball color
        self.color = [255,255,255]
 
    # --- Class Methods ---
    def move(self):
        self.x += self.change_x
        self.y += self.change_y
 
    def draw(self, screen):
        pygame.draw.circle(screen, self.color, [self.x, self.y], self.size )

#main program (which is defined as a function)
def main():
    pygame.init()
    
    # Set the width and height of the screen [width, height] and caption
    size = (700, 500)
    screen = pygame.display.set_mode(size) 
    pygame.display.set_caption("My Game")

    # Used to manage how fast the screen updates
    clock = pygame.time.Clock()

    # define theBall
    theBall = Ball()
    theBall.x = 100
    theBall.y = 100
    theBall.change_x = 2
    theBall.change_y = 1
    theBall.color = [255,0,0]

    # -------- Main Program Loop -----------
    done = False
    while not done:
        # --- Main event loop
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                done = True
    
        # --- Game logic should go here
    
        # --- Screen-clearing code goes here, don't put any other drawing commands above here
        # If you want a background image, replace this clear with blit'ing the background image
        screen.fill(BLACK)

        # --- Drawing code should go here
        theBall.move()
        theBall.draw(screen)
        # --- Go ahead and update the screen with what we've drawn.
        pygame.display.flip()
    
        # --- Limit to 60 frames per second
        clock.tick(60)
    
    # Close the window and quit.
    pygame.quit()
if __name__ == "__main__":
    main()