
Okay so I have been checking on the internet for an answer to my (some may say simple) collision detection problem. I have a car and I essentially want it not to drive through a wall or get stuck in it. I have tried to split the wall into four rectangles representing the four edges however it causes the car to move around in a very buggy manner.
Could someone tell me where i could find information or show me how to resolve the collision of a rectangular car with a wall as shown in the diagram? I want the car to carry on moving in a direction that does not cause it to go through the wall but like you normally would around it or away.
Look into the separating axis theorem.
You should really read this tutorial from the developers of N+. It has several interactive demonstrations so you can see the concepts that they describe.