I'm using masks to make collision detection in a game using pygame. The detection works well, but I have had problems with the behaviour after collision.
In most games, the obstacles are vertical or horizontal, making easy manipulate the velocity of objects moving. So, if the object collide, there is just two options: cancel x component or cancel y component. In this way, the object stop the move only in the normal direction.
But, my obstacles have any shape (not any, just rectangles and triangles) and direction, making things hard.
Basically, I want to cancel the velocity component in the normal direction to obstacle in the collision point.
Some help?
Thanks