Collisions with polylines/polygons in Tiled maps



  • Is it possible to collide with polyline objects created in Tiled? I created a FlxGroup of FlxObjects to set boundaries in a level, made up of rectangles and polylines. When I check to see if there is a collision in my update function, only the rectangle used as the level floor seems to result in a collision with the player, but polylines and polygons do not, and the player walks through them. Is this because they do not have any dimensions, with height and width being 0? I would like to implement behaviour similar to that seen in this post:
    http://retromaze.tumblr.com/post/109787649518/polylines-and-slopes

    but I have not seen anything indicating how I should do this.



  • HaxeFlixel simple collision engine only supports axis aligned bounding box (AABB), that is basically rectangle. Luckily, HaxeFlixel has Nape support which can do these. There are some HaxeFlixel Nape demos which you can learn from:



  • @DleanJeans Thanks again for the help. I had run across mention of Nape on a few forums, but was not familiar with it and did not realize it was what I was looking for. Hopefully these will steer me in the right direction at least.


Log in to reply