[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Rect collision by direction
Hello,
I've been trying to find a way to, when detecting collisions between two
sprites, determine which side of one sprite is colliding with the other.
Basically, I want to make it so that when a character walking to the
left collides with a block to his/her left, he/she stops moving, but if
the character is moving slightly downwards, he/she will continue moving
down, but stop moving to the left.
I'm sure there's some simple solution to this, which I have been missing
entirely.
Thanks!
--Skizzaltix