Choosing Image Point for Impulse

Get help using Construct 2

Post » Sun Jun 30, 2013 4:53 am

Hello dear community!

First of all, I am newbie at Construct 2. Go easy on me. I have a problem about Impact physics. I have a hand-grenade in game and I want to make when it explodes, some objects around it should blow away and just get away from it.

I am trying to do this with Impulse physics. But I must manually choose an image point which impulse impact on it on object. If I choose origin as image point, movement of object will be ok; but there will be no rotating effect on object at all. Force or impulse on center on mass do not have any impact on rotating force by law off physics. It seems so unrealistic to me. So, I want to change image point instead of origin.

I thought adding an image point to nearest point to explosion; but I could not find anything to do this during running program (Like AddImagePoint[X,Y,number] whatever). On the other hand, it is very awful to prepare image points before running program for every possible position in wall for grenade. Is there any solution else?

I am sending an image to understand situation well. Thanks...

krmlemre2013-06-30 04:54:00
B
3
Posts: 12
Reputation: 249

Post » Sun Jun 30, 2013 6:35 am

You can make it react more believably with just four image points (one in each corner) provided you calculate the force in a certain way..

First, instead of applying force to just the closest imagepoint, apply it to all four.
and secondly(you may have already done this), make the forces inversely proportional to the distance from the explosion...(so the imagepoints closest to the explosion have a stronger force applied to them)

It won't be perfect, but done this way, it will make objects rotate if the explosion is in the right place, like in your diagram.

you seem like you know what you're doing, but if you need more help i can send you a .capx i made a while ago with this in it.

a more 'realistic' way would be to make the explosion shoot out a bunch of smaller physics objects that collide with everything around it. (although that's overkill)
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sun Jun 30, 2013 6:49 am

yeps the scrapnel aproach i was also thinking, it works pretty good,
made an example..

scrapnel

(click to shoot scrapnel)

ps: not sure why it doesn't spread in 360 degrees, well it good be improvedvtrix2013-06-30 06:58:13
ImageImage
B
69
S
21
G
7
Posts: 827
Reputation: 10,017

Post » Sun Jun 30, 2013 4:41 pm

When I tried it seems a good solution, however it did not work on complicated sprites or thin-long shapes. I still need to find another way.

Maybe I should try another method else Impulse.
B
3
Posts: 12
Reputation: 249

Post » Sun Jun 30, 2013 4:41 pm

[QUOTE=vtrix] yeps the scrapnel aproach i was also thinking, it works pretty good,
made an example..

https://dl.dropboxusercontent.com/u/61666915/scrapnel.capx

(click to shoot scrapnel)

ps: not sure why it doesn't spread in 360 degrees, well it good be improved[/QUOTE]

It is from beta. I am using stable version and could not open it.
B
3
Posts: 12
Reputation: 249

Post » Sun Jun 30, 2013 5:19 pm

Just download the latest beta ,

I don't think he is going to downgrade his C2 just for you
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Sun Jun 30, 2013 7:06 pm

Shrapnel is a good way to deal with explosions, but it is not perfect. I am trying to find a good way to use particles as shrapnel instead of sprites.

Other ideas are still welcomed! Please share how you may deal with this problem.
B
3
Posts: 12
Reputation: 249


Return to How do I....?

Who is online

Users browsing this forum: ksiads, R0J0hound, RozekEnhance and 7 guests