Random geometric shapes

#1

Hey all,

I’m really new to mobile game develpoment and after comparing multiple engines I was most impressed by Defold.
After reading this Does defold support only three shapes for collision? (SOLVED) I’m not sure about whether I can implement my idea like I want to.

First of all is it possible to create random geometric shapes with defold? Random would mean different amount of edges, scale and so on.
Second is it possible to assign these random generated shapes a corresponding collision objects with the factory?

Thanks in advance

0 Likes

#2

You can’t generate shapes from scratch programmatically, but you can build shapes out of preset pieces, if that would work for you?

0 Likes

#3

Preset pieces sounds like it could work. Does an automatic assignment of a corresponding collision object work for them too?

0 Likes

#4

You need to construct game objects with sprites and corresponding collision shapes and build from that set.

1 Like

#5

Note though that we have an issue with scaling collision geometry. There are a couple of threads on that matter here.

See, for instance, Scaling Collision Object when Game Object is scaled (DEF-521)

1 Like