destructible terrain

For questions about using Classic.

Post » Sun Apr 13, 2008 9:08 am

I was wondering if there is any way to make destructible terrain in Construct? (the kind of terrain that is in worms and lemmings)
B
3
G
4
Posts: 28
Reputation: 1,133

Post » Sun Apr 13, 2008 9:26 am

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.
B
37
S
19
G
18
Posts: 613
Reputation: 10,231

Post » Sun Apr 13, 2008 10:12 am

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.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sun Apr 13, 2008 1:00 pm

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 :)
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Sun Apr 13, 2008 4:17 pm

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.
B
3
S
2
G
4
Posts: 310
Reputation: 2,120

Post » Sun Apr 13, 2008 7:43 pm

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,498

Post » Mon Apr 14, 2008 10:37 am

I've made a very simple destructible terrain http://www.mediafire.com/?b0gxxwt3j1k
B
4
S
2
G
4
Posts: 164
Reputation: 2,178

Post » Mon Apr 14, 2008 11:13 am

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 :D
B
3
G
4
Posts: 28
Reputation: 1,133

Post » Mon Apr 14, 2008 11:41 pm

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!

:o :o [color=indigo:2uus3efg]Dear God! Make Ashley put this on the to-do list![/color:2uus3efg] :o :o
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Tue Apr 15, 2008 7:05 am

[quote="Attan":2j4swbi1]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!

:o :o [color=indigo:2j4swbi1]Dear God! Make Ashley put this on the to-do list![/color:2j4swbi1] :o :o[/quote:2j4swbi1]
Or just Canvas with transparent background and pixel collision...
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests