# How do you use the polygon to do a collision

**URL:** <https://discourse.mapeditor.org/t/how-do-you-use-the-polygon-to-do-a-collision/103>\
**Category:** Questions\
**Created:** [December 15, 2014, 2:41am UTC](https://discourse.mapeditor.org/t/how-do-you-use-the-polygon-to-do-a-collision/103 "2014-12-15T02:41:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkm758962466](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@jkm758962466](https://discourse.mapeditor.org/u/jkm758962466)\
**Post date:** [December 15, 2014, 2:41am UTC](https://discourse.mapeditor.org/t/how-do-you-use-the-polygon-to-do-a-collision/103/1 "2014-12-15T02:41:26Z")

</div>

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（滑雪大冒险）](http://pic.baike.soso.com/p/20131217/20131217162100-518670038.jpg).

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [December 17, 2014, 10:43am UTC](https://discourse.mapeditor.org/t/how-do-you-use-the-polygon-to-do-a-collision/103/2 "2014-12-17T10:43:26Z")

</div>

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](http://www.angusj.com/delphi/clipper.php)).

At the moment Tiled has no built-in export features to help you with that, though for Unity there is [Tiled2Unity](http://www.seanba.com/Tiled2Unity) which supports this kind of stuff.

---

<div class="post-metadata">

**Author:** ![jkm758962466](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@jkm758962466](https://discourse.mapeditor.org/u/jkm758962466)\
**Post date:** [December 18, 2014, 3:02pm UTC](https://discourse.mapeditor.org/t/how-do-you-use-the-polygon-to-do-a-collision/103/3 "2014-12-18T15:02:43Z")

</div>

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](http://you.At) the end,thank you very much
