destructible terrain

This forum is currently in read-only mode.
  • I was wondering if there is any way to make destructible terrain in Construct? (the kind of terrain that is in worms and lemmings)

  • I don't think there is at the moment.

    I think with these games you use pixel perfect collision on the ground sprite (none transparent pixels) then to destroy part of it you subtract part of the image by saving that area as transparent in the shape of the colliding sprite object (bomb/bullet).

    I don't think construct can do this yet.

  • Well a way that would work for a small game area (because it would lag for a big area) would be to make a small ground sprite (between 10x10 or 32x32 in size) and make the whole terrain out of the sprite pieces. Then you would just destroy the sprites that are in contact with the bullet/bomb. If you want to make the terrain look more realistic you could make the ground sprite a circle instead of a square (but it would take more sprites to make the terrain)

    If you want I could make a .cap and pm it to you.

  • Its probably possible. I think its all about using the canvas object. But im really not sure as this is something i've always been scared of

  • My first thought would be to create a layer and set a large area to activate as a mask. I don't know how the masking effect works in Construct, though.. If it works with pixel-perfect collisions then you have an option there.

  • You could do it with masks or canvases, but the collisions won't update dynamically. I think it needs an update to the canvas object to modify its collision area.

  • I've made a very simple destructible terrain http://www.mediafire.com/?b0gxxwt3j1k

  • Thanks to everyone for their answers But I haven't quite figured out how to do this yet. I ran into some problems with the canvas, since I'm using platform movement as well. If a sprite with platform movement is placed on top of a canvas object with the solid attribute, the sprite will treat the entire canvas object as solid, not only the non-transparent pixels. So the sprite will be standing in thin air.

    (or maybe I have misunderstood how you're supposed to use the canvas, that is also a very real possibility )

    AS for JayJay and Casho's suggestions (thanks for the .cap ), this method seems to be working, but I'm worried about how much resources this would use on a large scale? It could easily be several thousand sprites. I'm worried that would give performance problems, but I'm not sure, does anyone know how many sprites are too many?

    As for using a mask I'm pretty clueless on how I would actually do that in Construct?

    Any help is appreciated

  • It would be wonderful with something like:

    Ground is overlapping Explotion

    -Cut Explotion out of Ground

    It would open a whole bunch of doors! Games like Liero, Worms etc. would finaly be possible to make!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It would be wonderful with something like:

    Ground is overlapping Explotion

    -Cut Explotion out of Ground

    It would open a whole bunch of doors! Games like Liero, Worms etc. would finaly be possible to make!

    Or just Canvas with transparent background and pixel collision...

  • You shouldn't use thousands of sprites to do this, it's an inefficient solution to the problem. The best way involves adding something like Attan's suggestion to Canvas, which I've planned for a while, but not got round to. So I'd say wait until then to make your destructible terrains.

  • Can anyone say "pixel perfect physics masks on canvas objects" (ten times really really fast )

    In my mind, it's synonymous with "HELL YEAH"

  • Sorry for dredging up an old thread, but can someone link me to a more modern example of this?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)