This question already has an answer here:
- 2D collision detection 5 answers
I am new to pygame and am creating a small game in which players can push each other to go outside the given arena to score points.
I have a problem in detecting when characters run in to each other. I have a player sprite and enemy sprite to detect collision (pygame.sprite.spritecollide), but to take any action after that is very tricky and am not able to cover all the possible cases. In most of the examples, it is always an immovable object (wall/maze/tanker etc) on the other end and so it is relatively easy to implement. But, with both characters moving, I am unable to calculate exactly and deal with this. Also, my characters just shouldn't run in to each other but can be close enough - because they'll have to be able to push each other.
Can anyone give pointers to implement this.