Coordinates within Defold

I create a game object with a factory and plan to map it to HardonCollider, an external collision library with a very bad name.

The reason I can’t use Box2D is the way it behaves in HTML5 when on an external monitor (70fps) or iOS low power mode (30fps). Vsync off and frame cap 0 is very stuttery.

Now, the dilemma I have is how to map the polygon coordinates to the sprite. Game objects manually distributed along the edges of the shape would work, but I can’t use game objects in a game object file (loaded by a factory). Sprites could work, but there is no way to get their position.

I would prefer to define the collision polygon coordinates within Defold, to avoid the external software dance. Any ideas how to tackle this?

I use Sketch App for the art. Maybe loading .svg files could work? If so, is there an XML parser in Defold?

No, the files are human readable protobuf. If you create a collision object with a few shapes you can open it in a text editor and see how it is constructed.

1 Like

That’s cool! I don’t think it helps me in this case, though, because the shape I’m making for HC is a convex polygon.

Aha. Check out this thread: Defold Polygon Editor

2 Likes