Simple 2d physics tutorial for terrain collision detection

I am looking for a tutorial that will show me how to do simple 2d physics such as this ( http://www.teagames.com/games/tgmotocross/play.php ). The part that interests me the most is how collision detection is performed between the character / player and the terrain, and how to store / generate the terrain.
The language of the textbook does not matter - I'm just wondering how to do this in general.
Thank you very much.


EDIT . To clarify, I already know how to perform collision detection between two sprites and enough physics to write the 2nd game. I specifically look at a tutorial / example on how to implement with a smooth surface that you can encounter (I understand how landscapes collapse, and I believe that this will be somehow connected). In addition, I know the lessons of N, but use discrete figures, while I am interested in a smooth landscape.

+4
source share
3 answers

I suggest you take a look at the Farseer Physics Engine , which is a 2d .NET engine written in C #. You can look here for some examples of using this package. Very easy to use and understand. Great place to start to understand such things. In addition, people who produce the product are very easy to get and talk if you have questions!

+3
source

I found that this link is somewhat useful (mainly for a game like a worm) - below it says that if you want to find the normal at the point of collision (which is probably needed for the correct orientation of the vehicle), you should scan the area around the point collisions and create a plane for further mathematical calculations.

+3
source

I assume you already:

  • understand vectors
  • understand physics

Check it out .

+2
source

Source: https://habr.com/ru/post/1286165/


All Articles