Interacting with the terrain

Hello,

I’d like to make a Digger like game, where you can “eat” the terrain around you.
How do I change the terrain (including the colliders & physics) in runtime?
OR
Is there a pixel perfect collision model in Defold?

Thanks
M

One way is to use tiles. You can set tiles at runtime. See http://www.defold.com/ref/tilemap/#tilemap.set_tile:url-name-x-coordinate-y-coordinate-new-optional-optional

The available collision handling is through collision object shapes.

1 Like

Thanks for your answer.

I mis-explained what I wanted. While tiles would satisfy a Digger-like game, I’m looking for the effect you have in Worms, Scorched Earth, Liero, and such. Meaning the terrain is completely “edible” and changeable in all directions

Aha, yes that is very different. The graphics may be possible to solve with shaders but it’s probably gonna be very hairy. Collision is another matter and depends hugely on your use case. Again it may be technically possible but very cumbersome.

The upcoming extension system will provide much better options.

Okay, thanks!