Destructable Space Invaders Barrier - How do?

Get help using Construct 2

Post » Mon Jul 02, 2012 4:45 pm

Hi, still on my Space Invaders game and having trouble with the destructible barriers. There are a couple of posts on here that mention using the Canvas plugin, but the examples in those posts (by Ashley I think) aren't there any more so I'm a bit stumped.

Has anyone got an example of how to create a destructible barrier I could look at?

Thanks in advance.
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Mon Jul 02, 2012 6:44 pm

There's am easy way to do it if you are willing to forgo dynamic damage - just make every frame of the barrier one with different damage and add one to the frame when it is hit.

If you want dynamic damage, however, that's pretty difficult especially if you want to do it pixel-wise like the origial game.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Jul 02, 2012 7:16 pm

I've toyed with the idea of creating a frame for several possible hits but that wouldn't look right so I would prefer to do it dynamically. It doesn't have to be per-pixel, just close enough to look OK.

EDIT - I've just found the post I mentioned in-which Ashley created something that others have used for their own Space Invaders barriers. It's an old post though and the link to the file isn't there anymore - http://www.scirra.com/forum/destructible-terrain-095_topic34854.htmlvandinz2012-07-02 19:19:38
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Mon Jul 02, 2012 11:04 pm

@vandinz
That example was for Construct Classic(CC). There is also a space invaders game floating around for CC that uses the same approach.

The approach was to use the canvas object and paste an object with the "erase" effect into the canvas to remove bits of the barricade when a bullet hits it.

For Construct2 (C2) there is a Canvas plugin here:
http://www.scirra.com/forum/plugin-canvas_topic46006.html

And here is an example like the CC example:
http://www.scirra.com/forum/how-do-i-simple-worms-game_topic47872_post300449.html#300449
C2 doesn't have per pixel collisions so it has to be done manually.

Finally here is another way to go about it that doesn't use the canvas object:
http://dl.dropbox.com/u/5426011/examples12/destoyBarricade.capx
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Tue Jul 03, 2012 11:10 am

Thank you so much :)
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Tue Jul 03, 2012 1:00 pm

You're going to love me :)

I've copied your method (the final one) and although it seems to work OK instead of the blast creating a hole in the barrier, it puts a grey box there instead. I've gone through all the properties of each item and matched them up to yours but I can't figure out what I'm doing wrong.

Any chance of a heads up? Cheers

New CAP filevandinz2012-07-03 13:00:26
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Tue Jul 03, 2012 1:19 pm

On your layer 1, you need to set the "Force own texture" property to yes. (Select layer and the option will appear in the properties window to the left.)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jul 03, 2012 2:42 pm

Brilliant :)
B
19
S
5
G
4
Posts: 208
Reputation: 3,960


Return to How do I....?

Who is online

Users browsing this forum: Pandadoor, totoe, Zebbi and 19 guests