# Physics Explosion

Get help using Construct 2

### » Tue Oct 04, 2011 1:58 am

How would you do a physics explosion...

Say you place a bomb on an object and you want to apply force in a 360 degree angle. How would you do that...?

Am i right in thinking i'd need to create invisable objects say 8 of them to cover the minimum angles, then create the objects at time of explosion, giving each one a force in a certain direction, then create an impulse force for the objects they hit..?

Ha i think i may have answered my own question...

It would be nice to have that as an option in the physics already... would save alot of time, Explosion Force with variables to cover power and distance...

One other thing is if 3 objects have physics and they are on different layers how come they still interact..? i was trying to use drag n drop to place a bomb on an object, but it keeps moving the object i place it on. I know i can remove the physics on the bomb and it stops the interaction... but i just wondered.
B
40
S
15
G
11
Posts: 243
Reputation: 9,512

### » Tue Oct 04, 2011 2:17 am

-On Collision between Explosion and Object
= Apply force 1000 to Object in opposite direction of Explosion

If construct 2 doesn't have "in opposite direction of" then it needs it I say. otherwise do:

-On Collision between Explosion and Object
= Apply force 1000 to Object in direction of Explosion.Angle/Object.Angle*360

/ = devide   * = times

If not try:

-On Collision between Explosion and Object
= Apply force 1000 to Object in direction of Explosion.Angle/Object.Angle+270

It's something along those lines of math!

Just thought:

-On Collision between Explosion and Object
= Object look towards Explosion
= Apply force 1000 to Object in direction of Object.Angle+180

It's really similar to one of those, I'll make an example tomorrow!
dcrew2011-10-04 02:20:47
B
18
S
4
G
5
Posts: 226
Reputation: 4,087

### » Tue Oct 04, 2011 2:31 am

[QUOTE=tonycrew] One other thing is if 3 objects have physics and they are on different layers how come they still interact..? [/QUOTE]

This is answered in the physics basics tutorial

[quote]Note: Physics objects only interact with other physics objects.[/quote]

Kyatric2011-10-04 02:31:31
New to Construct ? Where to start

Please attach a capx to any help request or bug report !
Moderator
B
307
S
126
G
99
Posts: 7,385
Reputation: 73,871

### » Tue Oct 04, 2011 1:36 pm

I have completed the example, took 5 minutes to work out (I'll include a picture and file below)! :D

RedBlock = Explosion
BlueBlock = Boxes
GreenBlock = Walls

-BlueBlock on collision with RedBlock
= BlueBlock : Apply Physics Impulse 100 toward RedBlock.X, RedBlock.Y

It makes sense that impulse is basically (move away from another object) which is an explosion, so as soon as I saw the impulsion option I knew :) Have fun blowing up some blocks Tonycrew
B
18
S
4
G
5
Posts: 226
Reputation: 4,087

### » Tue Oct 04, 2011 6:16 pm

B
18
S
4
G
5
Posts: 226
Reputation: 4,087

### » Sun Nov 20, 2011 1:43 pm

Hi all,
I am new in Construct 2,

I changed events of dcrew project to remove the redblock and check the distance between mouse and blueblock, and adapt the force of the explosion with the distance between the mouse and the blueblocks.

http://dl.dropbox.com/u/10596159/Physics%20Impulsion%20%28Explosion%29.capx
zapoutix2011-11-20 13:43:56
B
14
S
5
G
2
Posts: 1
Reputation: 1,936

### » Wed Jan 18, 2012 11:12 pm

Nice effect zapoutix.
Thanks for sharing
B
38
S
10
G
9
Posts: 542
Reputation: 9,181

### » Thu May 31, 2012 7:03 pm

Question! Physic and other movement types can't mix?

I've created monster that chase after me, but the Physic expulsion just don't work on monster that are moving.

For the monster movement, i've tried "Move forward X pixels" "bullet movement", they both don't work...
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

### » Thu Sep 27, 2012 11:30 pm

Nice example. I need to do the same thing using platform.
B
130
S
51
G
25
Posts: 401
Reputation: 22,979