[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Collision Detection Handling



I have a group called actors, which consists of my Actor sprites. 
Critters in this group all call a function called flee(), which has
them run away from the player's ego actor.  That all works well and
good.  However, the actors sprites all end up on the same spaces, so
eventually, it looks like there's just one sprite, and they can't be
separated.

I tried setting a 

for all in pygame.sprite.groupCollide(actors, actors, 0, 0):
      all.Stop()

mechanism this morning, but it didn't work.  I expected them to at
least get stuck, because once they collided, they would remain
colliding and never be able to move again, but instead, the collisions
didn't even seem to register.

Thanks in advance.