title: Python OO-pygame cannon game. Unable to get the cannonball to move
body: <p>I am attempting to work on a homework for my Software Engineering class currently. We are creating a object oriented cannon game. We just need to get the cannon created and fire a cannon ball. </p>
  
  <p>Currently I can get my code to create a cannonball at the muzzle point of the Cannon, but the move function unfortunatly does not move the cannonball at an upward angle (attempting this first before starting the actual cannonball arc fire) Currently instead the cannonball (which i have made red for ease of seeing if it is created at the muzzle point of the cannon) stays where it is, and I have glimpsed the cannon itself move in the bottom right. I am perplexed as to what I could have done wrong. Or why I cannot get the ball to move as it should. </p>
  
  <pre><code>    import pygame
      from colors import color
  
  class Cannonball(object):
  '''
  classdocs
  '''
      _x = 135
      _y = 310
  
      def __init__(self):
          '''
          Constructor for cannonball. Initiates x and y at initial values
          of x == 135 and y == 310. at 30 FPS 
          '''
          self._x = Cannonball._x
          self._y = Cannonball._y
          clock = pygame.time.Clock()
          time_passed = clock.tick(30)
          time_passed_seconds = time_passed / 1000.0
  
  
      def draw(self, screen):  
          '''
          Draws the cannonball
          '''      
          sprite = pygame.draw.circle(screen, color["red"], (self._x,self._y), 5)
          return sprite
  
      def move(self, screen, time_passed):
          '''
          initiates the cannonball to move until its past the screen
          '''
          speed = 50
          self._x += speed+time_passed
          self._y -= speed+time_passed    
          pygame.display.flip()
  </code></pre>
  
  <p>Here is my cannonball class</p>
  
  <pre><code>    import pygame
      import sys
      from cannon import Cannon
      from cannonball import Cannonball
      from colors import color
  
      pygame.init()
      '''create the GUI window'''
      screen = pygame.display.set_mode((640,480))
      pygame.display.set_caption("Cannon Game")       
      background = screen.fill(color["white"])
  
      clock = pygame.time.Clock()
      '''draw the Cannon onto the window'''
      aCannon = Cannon
      aCannon.draw(aCannon, screen)
      pygame.display.flip()
  
      while True: 
          '''handle keydown and quit events for Cannon Game. Space bar
          fires the cannonball
          '''
          for event in pygame.event.get():
              if event.type == pygame.QUIT:
                  exit()
              if event.type == pygame.KEYDOWN:
                   if event.key == pygame.K_SPACE: 
                   aCannonball = aCannon.fire(screen)
                   cannon_ball = True
              if cannon_ball == True:
                   aCannonball.draw(screen)
                   aCannonball.move(screen, time_passed)
                   pygame.display.flip()
  </code></pre>
  
  <p>This is my Driver. Trying to keep that simple currently as it has helped me get things created so far. </p>
  
  <pre><code>    import pygame
      from colors import color
      from cannonball import Cannonball
  
      class Cannon (object):
          '''
          classdocs
          '''
  
      def __init__(self):
              '''
              Constructor
              '''
  
  
          def draw(self, screen):
              pygame.draw.circle(screen, color["black"], (40,400), 20)
              pygame.draw.polygon(screen, color["black"], ([30,400], [135, 300], [150,          320], [50,400]), 0)
  
          def fire (self, screen):   
              print("Fire") //used this as a tester to make sure the fire call worked before attempting to have a cannonball created and move. 
              aCannonball = Cannonball()
              aCannonball.draw(screen)
              aCannonball.move(screen)
  </code></pre>
  
  <p>And finally my cannon class which contains the fire function, which creates the cannonball, draws it to the gui and initiates it to move. </p>
  
  <p>I am still attempting to research what I could have done wrong but any help would be gladly appreciated. </p>
  
  <p>EDIT: I found the issue with the code in which my cannonball would not move. I was multiplying speed by the time passed rather than adding. It would shoot off the screen almost immediately before it could even be seen. </p>
  
  <p>Thank you for the help! Maybe I can move past this into the arc fire. </p>