I've been trying to make a game and I ran into an interesting problem. I have currently programmed a player that can move around, a box that represents a wall, and a collision detection function. My problem is that the player will stop when he collides with a wall, but then he can't move away or slide along it. So how do I get rid of this "sticky" wall?
You can't treat a collision as if the current move made the collision. The previous move made the collision. So, handling it in the code that handles the current move going out of bounds (and coincidentally leaves the player in the same place he started in) won't work.
Ok, I modified the player movement function and now he doesn't usually walk through walls anymore. However he bounces off of the walls instead of stopping smoothly, and there's a chance that he will get caught in the wall and all of his movements get reversed. How do I fix this?