How do you use the polygon to do a collision

Hello
I want to ask a question for my firend. He ask me how to do a collision to polygon.He want make a Parkour game,like the game ski safari(滑雪大冒险).

Well, you could use either a polygon or a polyline to describe your “ground” in Tiled, but that is the easy part.

In your game engine you would probably use a physics library like Box2D or Chipmunk. They will have restrictions on the polygon shapes (generally only allowing convex shapes) or the amount of edges on a polygon/polyline. Hence you will probably need to do some pre-processing on the data to make this work (for example using a library like Clipper).

At the moment Tiled has no built-in export features to help you with that, though for Unity there is Tiled2Unity which supports this kind of stuff.

1 Like

Your answer bring a big help to me and my friends. Thank you very much for always answer my questions.I got a lot of help for you.I don’t know how to appreciate your help.You are a very kind man.God bless you.At the end,thank you very much