I have a lunar lander type game. I don’t use any physics engines.
My lander keeps falling if you do not use thruster and eventually lands on the ground. Ground is hand drawn, it is not a line, more like curve, and the land can be of any configuration or color.
How do I properly use collision detection and its results?
I have a lunar lander type game. I don’t use any physics engines. My
Share
Well it depends on what you want to do. I would recommend one of the following:
Use physics engines. They are there for something. You could create different shapes what was drawn. You could mix in a rectangle if theres a straight line, or a lot of circles for curves, etc.
Use your own custom circle collision detector. You represent the lander with a bounding box sized circle. Then, for each of the handdrawn lines, create a bunch of adjacent circles representing the line. When you check your lander position, you are just basically looping through the circles representing the lines and checking for collisions. Incoming pseudocode