: I have been trying to get my collision detection to work, but I'm having problems. I can detect when they collide just fine, but I don't know how to determine which side of the player collided with. It is a side-view game (kind of like Mario). I want to be able to tell when the player is touching one of the sides, the top, or the bottom of the block. Do you have any ideas of how to solve this problem? Thanks.
To find out which side that is, check each side in succession to find the blocks. For example, to check if the player is colliding on the left, you'd check if there is a block along the left side of the player. But do not include the whole edge, you should cut off some pixels on each side of the edge, or you'll have problem.