title: Python Line-Circle collision
body: <p>Again this question is on PyParticles4.<br>
  <a href="https://stackoverflow.com/questions/14137475/python-ball-physics-simulation">Link to last question for reference</a></p>
  
  <p>Comment if unclear...</p>
  
  <p>I am working on a Shooter game, much like <a href="http://www.gamenet.com/game/Shooting-Games-Avalon-Siege/" rel="nofollow noreferrer">this</a>, but on a flat land with a wall that varies it's height on every turn(something for fun in the game) and with 2 players,each with a cannon that can move some distance (there's a limit, and they can't move beyond a certain amount from their start position) on each turn(the player decides if he wishes to move).  </p>
  
  <p>My code:</p>
  
  <pre><code>class Bullet(PyParticles.Particle):
      def hit_s(self,shooterlist):
          for shoot in shooterlist:
              #collision with the rect
              dist = math.hypot(dx,dy)
      def hit_w(self,wall):
  -------------------------
          #confusion
  -------------------------
      # other funcs to added
  class Shooter:
      def __init__(self,pos,size):
          self.rect = pygame.Rect(pos,size)
      # other funcs to added
  class Wall:
      def __init__(self,(sx,sy),(ex,ey),width):
          self.start = (sx,sy)
          self.end = (ex,ey)
          self.width = width
  # (things needed for pygame.draw.line()).
  </code></pre>
  
  <h2>My Problems</h2>
  
  <p>Collision of the bullet with the Wall. Any Ideas on how to know when the bullet hits the wall?  </p>
  
  <p>I think something faster would be better..  </p>
  
  <p>Also, if the ball hits the wall, the ball should bounce back so it has a chance to hit the player who shot it at first(Strong Wall!), and so the wall doesn't get cut, like in the game(mentioned at the start).</p>