Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
76

SortaBomber - Explosion Physics

tussiez
tussiez

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 new version! (with buildings)

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 😭)
2 years ago
You are viewing a single comment. View All
8
Bookie0
Bookie0

I have found....the unbreakable thingy:

Behold in all it's grandeur:

Screen Shot 2021-04-07 at 10.53.57 AM

Still here!
Screen Shot 2021-04-07 at 10.54.06 AM

So many explosions I've made the other orchid blocks go away!
Screen Shot 2021-04-07 at 10.54.33 AM

Now it's all alone! :(
Screen Shot 2021-04-07 at 10.55.21 AM

2 years ago
2
tussiez
tussiez

@Bookie0
Behold...

the parent object!

2 years ago
3
mollthecoder
mollthecoder

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

2 years ago
1
Bookie0
Bookie0

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

2 years ago
1
mollthecoder
mollthecoder

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

2 years ago
1
FlaminHotValdez
FlaminHotValdez

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

2 years ago
1
personmandude
personmandude

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

2 years ago