Destroy Objects Parts?

Get help using Construct 2

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

Post » Wed Dec 19, 2012 3:12 am

The canvas plugin can be used to do per pixel collisions on top of being designed to do the visual portion.

http://dl.dropbox.com/u/5426011/examples16/destroy_ball.capx
B
79
S
24
G
53
Posts: 4,732
Reputation: 40,227

Post » Wed Dec 19, 2012 3:15 am

@R0J0hound oh sweet I didn't realize, thanks R0J0! Jayjay2012-12-19 03:16:19
"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 » Wed Dec 19, 2012 12:07 pm

@R0J0hound
could you explain what test.AsJSON is ?

I can see its put into the array but i dont understand where the data comes from.

Is there any information about the canvas plugin anywhere.
B
44
S
15
G
9
Posts: 1,096
Reputation: 11,013

Post » Wed Dec 19, 2012 4:19 pm

http://www.scirra.com/forum/plugin-canvas_topic46006.html

i guess the array is to save the temp object form, and to read the new "collision mask" after bullet overlap.

thanks rojo, this is a good solution; but should be better integrated into c2.

currently got no idea, how to use this in combination with the solid behaviour in a platformer.

https://dl.dropbox.com/u/54216429/destroy_ball_demo.capx

any suggestions still welcome xeed2012-12-19 16:33:36
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Wed Dec 19, 2012 10:07 pm

@spongehammer
The canvas topic has most of the info about the plugin.
The .ASJSON expression is all the pixel data (red,green,blue,alpha in the range of 0-255) of all the pixels in a format that can be simply loaded into an array object.
A bit of a discription of it's use:http://www.scirra.com/forum/using-pixel-colors-as-reference-for-level-layouts_topic57020_post355255.html?KW=AsJSON#355255

@xeed
It's tricky to make the behaviors work with per pixel collisions.
Here I got it working with the 8direction behavior by moving the object back to it's last collision free location and setting the object speed to 0.

For the platform behavior the best method would be to create invisible solid walls only immediately around the player. That gives the behavior something to respond to.

Here is a example that creates a platform if pixels are in range:
http://dl.dropbox.com/u/5426011/examples16/destroy_ball_with_platform.capx
I increased the size of the test object to increase the sampling area, but it also slows everything a bit.
B
79
S
24
G
53
Posts: 4,732
Reputation: 40,227

Previous

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Artpunk, Bad Wolf, cesisco, davides, NRABrazil, Vallar and 29 guests