Explosion

Get help using Construct 2

Post » Mon Aug 13, 2012 9:10 am

Hi
I see some topic's about explosion, but i need some good idea how make it work smooth.

I wanna make with some TNT and Granades, using physic and i dont know how make explosion with is stronger if is near object and have less power when is litte far.

(sorry for my english)
B
9
G
2
Posts: 17
Reputation: 1,444

Post » Wed Oct 17, 2012 3:12 pm

Any ideas on this? I'm also interested.
B
63
S
23
G
17
Posts: 254
Reputation: 14,342

Post » Wed Oct 17, 2012 5:51 pm

You could use the DISTANCE system expression. Get the result and depending on how far apart they are, use a different animation, or force etc to display the explosion.

distance(x1, y1, x2, y2)

Here's a simple CAPX to show you. Click the mouse around the red sprite. The closer you are the bigger the explosion (boom is a small one KABOOM! is bigger). Of course you could set a few tests to increase the size of the explosion as you get closer, but for this I've only done one test.

BOMB TEST CAPX

Shout up if you need more help :)
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Wed Oct 17, 2012 7:08 pm

Using distance looks nice, but I would like a more dynamic explosion instead of just 2 or 3 levels of strength. For instance, if the explosion happens 1 pixel away from an object, then apply a strength of a 99, if it's 2 pixels away, strength of 98...etc. I guess we could still use the distance expression for it, but the problem is it would be reversed, the closer the explosion happens, the less potent the number would be: 1 pixel away = strength of 1, 2 pixels away = strength of 2.Xavier2012-10-17 19:09:43
B
63
S
23
G
17
Posts: 254
Reputation: 14,342

Post » Wed Oct 17, 2012 9:25 pm

What you do with the explosion is up to you, I could've made it say boom closer to the player (square) and KABOOM! if it was further away. As for a smoother check, I'm not 100% on that, there is probably a formula you could use (maybe using the LERP command?) I'm sure someone smarter than me could help with that on here.

:)
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Wed Oct 17, 2012 10:07 pm

there are number of ways you can make explosion with physics, but here is one extremely ugly way to do it (always love to construct when i'm drunk) .

you can even check for LOS to make it more "real"

exploding bomb that explodes

edit: change range to limit bomb "infuluence"/radius, left clikc for bomb, right click for TNT(left clikc on TNT to acivate it), play with values of power...podpathos2012-10-17 22:11:43
B
12
S
2
G
2
Posts: 96
Reputation: 1,583

Post » Thu Nov 01, 2012 9:59 pm

Wow Man, that's awesome! Thats the effect i want have in my game. Thank You :D
B
9
G
2
Posts: 17
Reputation: 1,444


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Axiomaltd, MACPK, nicklowkcmagic, OddConfection and 25 guests