Original Post
I am having problems setting up a decent collision detection system for my 2d side scroller game. It is not the actual collision detection I am having problems with but more the collision response. I am using only AABB but I think I need to find which side of the box I am colliding with to handle it appropriately. The way I am doing it now involves setting the position back to the old one like this... update(entity): entity.old_position := entity.current_position modify entity.current_position based on entity.velocity and other factors if Colliding(entity) then entity.current_position := entity.old_position the problem with this is that the object (player to be more specific) may be constantly colliding with the ground tile due to gravity and resetting the position does not allow the character to walk and move around horizontally. I thought if I could set just the Y position or just the X position that would work better but I need to know which side it is colliding with to do this correctly. This seems like a lot more work for 2d collision detection then it should be, am I making this too complicated or is there an easier way to handle this?
