Destroy Objects Parts?

Get help using Construct 2

Post » Mon Dec 17, 2012 9:22 pm

Hi,

for my platform game, i want a solid sprite when hit by a bullet to lose a radius of the (image) area. it should be able to get destroyed. This loss should not only result in a new image, but also a new collision polygon, everytime this event occours.

Can i currently handle such complex object changes with c2 during runtime?

Thanks and best regards :)
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Tue Dec 18, 2012 3:48 pm

No i am afraid this is not possible. There is no way to detect where the bullet hits the sprite for a start.
Also as far as i am aware it is not possible to create a new collision polygon on the fly either.

You could create a sprite with multiple frames, each with its own collision polygon. But the shapes would be pre-set and would not reflect the point of collision with the bullet.spongehammer2012-12-18 15:54:38
B
44
S
15
G
9
Posts: 1,096
Reputation: 11,013

Post » Tue Dec 18, 2012 4:10 pm

Worms style destructible terrain/objects right? I'd be interested to see if anyone could come up with a solution.thehen2012-12-18 16:13:30
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Tue Dec 18, 2012 5:24 pm

Here is something i have been playing around with for a while.

http://dl.dropbox.com/u/1685424/index.html

Made to run in Chrome.
B
44
S
15
G
9
Posts: 1,096
Reputation: 11,013

Post » Tue Dec 18, 2012 7:39 pm

[quote]Here is something i have been playing around with for a while.

http://dl.dropbox.com/u/1685424/index.html

Made to run in Chrome. [/quote]

yeah, this is getting in the right direction. would you share the capx with us?
B
15
S
3
G
5
Posts: 396
Reputation: 4,977


Post » Tue Dec 18, 2012 11:48 pm

I will have a think about it. I would need to tidy it up and add some comments to make it more accessible.
B
44
S
15
G
9
Posts: 1,096
Reputation: 11,013

Post » Wed Dec 19, 2012 1:43 am

You can do it visually using masking. However, collision polygons will be a different matter. I don't see of any good way to go about getting collision to work in this respect.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Dec 19, 2012 1:48 am

I have some ideas 'bout this ... I could work on it ... Well , Tuning In !
Something I can say is that it's not impossible , I'll need to create a event-based collision system using points and linesWhiteclaws2012-12-19 01:49:47
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Wed Dec 19, 2012 1:57 am

@Squiddster, would a mix of that and collision conditions "Object overlaps Ground & Object NOT overlaps Mask" work? Maybe something where you give the mask object a collision polygon such that the player only collides with it when they are near its center/one edge (and angle the mask so that it's always at the angle of the bullet that collided?).

Kind of hard to explain so I will create a small example file

Edit: Here's an example of basic destructible terrain, you can use image masking as Squiddster said to show the true background I think (maybe using the canvas object?): Sprite terrain erase/destructible terrain example

Double edit: R0J0's canvas plugin is a better way to do it, but until plugins are available on the arcade you can use this method above.Jayjay2012-12-19 16:58:28
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Next

Return to How do I....?

Who is online

Users browsing this forum: ManuelPerez and 23 guests