mine explosion physics

Get help using Construct 2

Post » Mon Oct 21, 2013 6:51 pm

Hello,

when a ball object fell down on a mine (bomb) object I would like that ball to be thrown away because of that explosion...

how to do that? cant figure it out...

thx
B
13
S
4
Posts: 105
Reputation: 1,503

Post » Mon Oct 21, 2013 7:25 pm

Got a little carried away with it all. So let me know if I need to make it more simple :-)

.capx

You can disable/enable the mine to see the difference.

Basically I apply an impulse to the ball when it collides with the mine.

Hope it helps.
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Tue Oct 22, 2013 8:27 am

@cvp

thats what I was looking for... thank you mantrance2013-10-22 08:28:04
B
13
S
4
Posts: 105
Reputation: 1,503

Post » Wed Oct 23, 2013 5:05 pm

@cvp

man one more question, whenever the ball hit the mine it always throw the ball to the right

when the ball hit that mine from the left side I would like that ball to be thrown to the left...
B
13
S
4
Posts: 105
Reputation: 1,503

Post » Wed Oct 23, 2013 6:51 pm

I have modified the example a bit.

.capx

I have changed it to impulse at angle instead.

And if you use:
angle(0,0,ball.physics.velocityx,ball.physics.velocityy) you will get the current angle of the ball.

Then i deduct 180 degrees to get the opposite direction.

I played a bit around with the impulse speed. you can set that to what you want.
In the example I have set it to be dependent on the speed with witch it hits the mine. (by using distance instead of angle)
But play around with it and see what works for you.
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Thu Oct 24, 2013 10:16 am

excellent...thanks
B
13
S
4
Posts: 105
Reputation: 1,503


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, Mayfly and 9 guests