title: Pygame simple bouncing animation
body: <p>I have this program from a pygame tutorial:</p>
  
  <pre><code>import sys, pygame
  pygame.init()
  
  size = width, height = 320, 240
  speed = [2, 2]
  black = 0, 0, 0
  
  screen = pygame.display.set_mode(size)
  
  ball = pygame.image.load("ball.bmp")
  ballrect = ball.get_rect()
  
  while 1:
      for event in pygame.event.get():
          if event.type == pygame.QUIT: sys.exit();
          ballrect = ballrect.move(speed)
          if ballrect.left &lt; 0 or ballrect.right &gt; width:
              speed[0] = -speed[0]
          if ballrect.top &lt; 0 or ballrect.bottom &gt; height:
              speed[1] = -speed[1] 
  
          screen.fill(black)
          screen.blit(ball, ballrect)
          pygame.display.flip()
  </code></pre>
  
  <p>It is a simple bouncing ball. What I want is to replace the ball (ball.gif) with a circle which will be drawn using pygame without making big changes to the code. I mean, the only thing I want to change is the ball by replacing it with a circle and animate that circle with the same code I used to animate the ball. Is there any way I can do that? Thanks.</p>