I have a game where you build a spaceship with a simple editor on a map of square tiles. I then export it into a ship that can fly around in flight mode while controlling someone walking around inside (sort of diabloish control scheme). For the ship-player collisions I just have a square collision object for each tile.
Instead of trying to translate every tile with complex rotations every frame when moving the ship I decided to leave it at origin and draw it to a canvas instead, and move that around. I still need to be able to generate a collision object for the ship to use in the global scheme of things, however, so what I want to be able to do is take my tilemap data and basically "shrink-wrap" it so that I end up with a shape that shows its outline.
I'm using hardoncollider, so basically I need to find all the points in order and add them to a table, then call something like:
Code: Select all
ship[1].shape = worldcollider:addPolygon(unpack(point_table))
Thanks!