I'm trying to create a 2D car game with a side view (something like Hill Climb Racing, but much simpler), but I'm confused in mathematics and physics.
Most of the tutorials I found were about how to make a top-down view game. The rest referred to the Unity3D engine, which performs all the calculations behind the scenes and uses complex objects, while I would like to achieve my goal using simple objects, such as 2D vectors and abstract them on my own (ie without any type of engine of games).
The project in which I am working assumes that a car is a rectangle with 2 wheels, which are ellipses. You do not need to brake, reverse and accelerate, you just have to keep going straight (and, finally, stop in case you lose all your speed).
An example of terrain where you would drive the car:
I can not figure out how to move the car on uneven terrain, how to turn and move it when it falls off a hill, etc.
Do you have any idea how to move and rotate the car with respect to its current position and speed?