title: Making sprites bounce off of each other
body: <p>To download the code, follow the <a href="https://docs.google.com/file/d/0Bw0wBMBY3U44MjBDM2VFdU1JRW8/edit?usp=sharing" rel="nofollow">link</a>:</p>
  
  <p><strong>Background</strong>:</p>
  
  <p>So I've been going through pygame tutorials since I'm new to it and I found Eli Bendersky's well-known <a href="http://eli.thegreenplace.net/2008/12/13/writing-a-game-in-python-with-pygame-part-i/" rel="nofollow">tutorial</a>. I was going through part one and was attempting to add my own flair to it by making it "Social Cats". The cats would wander around and if they touched each other then they would graze each other and go their separate ways. In other words the same thing Eli had but with collision detection and new sprites. I figure this would be good practice. I've spent the past few days researching collision detection and how different people do it, but I've yet to see one that would work with my scenario or something similar. I'm beginning to see how small of a community I'm in.</p>
  
  <p><strong>Objective</strong>:</p>
  
  <p>Ultimately, I am trying to make it so when a cat runs into another one, the one that collided will go off in a random direction that equals 45 degrees less or more than its current direction.</p>
  
  <p><strong>Problem</strong>:</p>
  
  <p>I'm importing vec2d and I have my Cat class and my main. I would like to do the collision detection in the main because later on I will create a GameManager class that watches over what's going on. According to OOP, the cats shouldn't know about each other anyways. I've been having trouble getting the collision detection to work. I've tried a couple of different ways. In both ways nothing happens when they touch each other. I'm getting the impression what I'm wanting to do is way more complex than how I'm perceiving it. How am I screwing this up? I feel as if I've wasted enough time on this one aspect. Of course, that's the learning process. Thoughts?</p>
  
  <p>Way 1:</p>
  
  <pre><code>    mainWindow.fill(_white_)
      for cat in cats:
          cat.update(timePassed)
          cat.blitme()
          catsCollided = pg.sprite.spritecollide(cat, catGroup, True)
          print pg.sprite.spritecollide(cat, catGroup, False)
  
      for cat in catsCollided:
          cat.currentDirection.angle = randint(int(cat.currentDirection.angle - 45), int(cat.currentDirection.angle + 45))   
  </code></pre>
  
  <p>Way 2:</p>
  
  <pre><code>    mainWindow.fill(_white_)
      for cat in cats:
          cat.update(timePassed)
          cat.blitme()
          print pg.sprite.spritecollide(cat, catGroup, False)
  
  
      tempCatList = list(cats)
      for catA in cats:
          tempCatList.remove(catA)
          for catB in cats:
              if catA.rect.colliderect(catB.rect):
                  cats[cats.index(catA)].currentDirection.angle = randint(int(cat.currentDirection.angle - 45), int(cat.currentDirection.angle + 45))
  </code></pre>