Share your repls and programming experiences

← Back to all posts
SortaBomber - Explosion Physics
tussiez (1676)

SortaBomber

Blow up stuff.

This is my replica of Roblox's "welds" system. This groups static objects together, e.g buildings, but when hit above a set speed, the building will break.

Controls

  • (RIGHT) click and drag to look around.
  • (LEFT) click to fire explosives.

Improvements

I modified Physijs to work with the WASM version of Ammo, which has improved performance by.. a lot. It's now possible to simulate a few hundred blocks now without any lag. I would update the car physics game with this, but there are a few underlying problems with Physijs itself and Ammo (I spent a few hours getting collisions to work correctly), which means more bug fixing :/

How it works

Objects are first added to a parent object. This makes them a compound shape. Explosions are calculated by their position and force. The overall group has a set "strength", and this is reduced by repeated explosions, amplifying the damage done. The velocity of an object is reduced by the distance it is from the explosion, and increased by the explosion force. Objects farther away from the bomb move slower, and vice versa. Because objects cannot move independently from their parent, the ones nearest to the explosion are orphaned and made dynamic. Simply removing the object from the parent and adding it to the scene doesn't work, so I clone the object (probably a bad idea) instead.

Enjoy!

Play it!

Not working?

This Repl uses experimental technology that may not yet be supported across all platforms and browsers. For the best experience, use the following:

  • A home desktop/laptop computer, some schools may block some files
  • Chrome 89 or as recent as possible

What may be the issue:

  • WASM
  • Module Web Workers
  • WebGL
  • ES6 (Don't use Internet Explorer :sob:)
Comments
hotnewtop
Bookie0 (6358)

I have found....the unbreakable thingy:

Behold in all it's grandeur:

Still here!

So many explosions I've made the other orchid blocks go away!

Now it's all alone! :(

tussiez (1676)

@Bookie0 Behold...

the parent object!

mollthecoder (34)

@Bookie0 I see you use ChromeOS. It seems everyone on replit does.

Bookie0 (6358)

@mollthecoder i uh don't. I use macOS what makes you say that?

mollthecoder (34)

@Bookie0 My mistake. I said that cause the cursor was the same as Chrome OS's cursor. It seems they have the same cursor.

FlaminHotValdez (714)

@mollthecoder I'm on Ubuntu 20.04 and I also have the same cursor

personmandude (3)

@mollthecoder I am on a school chromebook for coding in school and a bunch of other people probably are

LaneMartin (108)

Let's honor the people who play this without a mouse.

LaneMartin (108)

@LaneMartin This is how the Germans bombed London:

tussiez (1676)

@LaneMartin

"Can you see where it's going to land?"
"No."
"Just spam it ig"

AryyanVineeth (18)

@LaneMartin I played this without a mouse.

OldWizard209 (1608)

Wait, firstly, it says:

Assuming it is "Physics" with a "C", How in the "PHYSICS WORLD" does this make sense?:

Oh or probably it is just the subject of "Physijs" not "Physics".

IronStarkMan (16)

Well, IMMA call Mr.Neil deGrasse, this can't be tolerated. @OldWizard209

DavidHilsee (3)

@OldWizard209 it says physijs because it is written in javascript (aka js)

SudhanshuMishra (252)

The dust clears

It still stands

LaneMartin (108)

You should add an option where you can have more than 1 tower but the maximum in 10 so it feels like bombing an entire city and not just a puny building.

Soccer135246 (7)

I like how you can launch bombs from the top, change the angle, and view it like a 3D bombing simulation

Soccer135246 (7)

@Soccer135246 oh wow I can hit them from under and they still move...

EliasTheGreat (45)

This is really cool, with nice physics, the only citicism about it I have is the update ing of physics, it looks like a bomb only updates blocks around it and dosn't account for physisics that was not in the radious of the blocks

jihhyuu202 (14)

Reasons why:
1. roblox physics
2. roblox physics
3. roblox physics
4. roblox physics
@EliasTheGreat

LeonNicosia (0)

do NOT use an autoclicker

ch1ck3n (2335)

@LeonNicosia screw you i put it at 1 millisecond

tussiez (1676)

@ch1ck3n I laugh because I know what happens

LeonNicosia (0)

@ch1ck3n i did put it at 1 millisecond

[deleted]

Does not work on Chrome 76/ChromeOS
It works if I boot up Ubuntu 20.04 on my chromebook tho with Chrome 89

tussiez (1676)

@novaflippers school chromebook? This uses a lot of experimental stuff, it’s not implemented and supported everywhere yet

[deleted]

Which library was this built with?

tussiez (1676)

@novaflippers Threejs (WebGL) and Physijs (physics, using Ammo --> pybullet)

[deleted]

@tussiez ooo ty

PyCoder01 (58)

this is basically roblox 2007

PyCoder01 (58)

the ball is from crossroads roblox lol.

FlaminHotValdez (714)

*throws a literal bomb at the tower*
*blocks explode*
*top of the tower doesn't fall down*
Ah yes, physics.

Or is it fisix?

[deleted]

pog

[deleted]

@tussiez

poggers

[deleted]

@tussiez super duper pogger

FlaminHotValdez (714)

solid proof that green is better than purple. Time to spraypaint my room

LaneMartin (108)

COME ON @tussiez ONLY 4 MORE TO GO:

FlaminHotValdez (714)

@LaneMartin boi...why do you care about cycles? they are useless internet points. Also that is weekly...In the long run, RayhanADev is more than 500 cycles ahead of tussiez anyway

alpha2442 (2)

Neither the window in this repl or another tab will load... How long should I wait?

alpha2442 (2)

@tussiez even if I press run it doesn't work bruh

tussiez (1676)

@alpha2442 Are you using a personal not school, desktop computer and Chrome? A lot of my Repls use experimental technology

alpha2442 (2)

@tussiez yeah I'm using a PC and also chrome

tussiez (1676)

@alpha2442 Latest version? Huh, send me a screenshot of DevTools' console and Network tab

alpha2442 (2)

@tussiez i restarted my tab and also closed all of my tasks i don't need in windows task manager and it seems to be working now because the program needs quite a bit of power to run apparently

tussiez (1676)

@alpha2442 True - it's a 3D physics engine

DavidHilsee (3)

@DouglasGoodyear you know what he meant why do you have to be like that

SudhanshuMishra (252)

What are you doing here you should be in mojang

RahulChoubey1 (183)

the second slider's snap is 1, not .5, which makes the bomb explosion numbers funni