Sci-Fi tunnel + Space Invader 3D shooter fast prototype

the code is bit a mess, but I was just learning all the stuff, putting multiple techniques together. Play around with the controls, You can create pretty cool effects. Note that small camera move speed and small next segment treshold equals thousands of objects! So keep them balanced.

Hit + to log the actual controls state as JSON to the console and creating a keyframe. Add multiple keyframes. Copy and paste the last logged JSON and replace the pathData variable found at the top of the source. Change animationLength to how much seconds should the tunnel stay in the current state and skip to the next frame.

You can keep the controls open by pressing Space when in play mode to see how the controls are lerping from the current to the requested state. Keep in mind, this is code is far from production ready, I just put all together in a quickly manner, so there is a lot bullsh*t, I am aware of it :slight_smile:

I started to add explosion of the enemy blocks, the big block is killed, a 3x3x3 is cube from smaller cubes is spawned but got lazy. Actually 95% of the code is ready, there is just an issue placing the explosion obect into world space. Afterwards correctly apply an applyRadialExplosionImpulse to the center of the big cube. Next step, using thin instances instead of regular one (some code already present).

Let me know whether you like it:

UPDATE New version with GPU instancing


something wrong with perf =(
but looks nice anyway =)

Hey @roland.csibrei there’s an error: “Error at [16,28641]:i.initFunction is not a fuction”. Any idea what I should do?

Hi there!
There is a new version being coded and you can have a peek at it here:

It runs 144 FPS on my machine (i9, GTX1070) Some stuff is still missing (wireframe, glow) After I finish it, I will make the code running in the Babylon sandbox, so you can have a look at it.


1 Like

It should run out of the box, that’s the way the Sandbox works. What browser do you use?

I’m using Firefox 72.0.2 (64-bit).

Yes, weirdly it is not working on Firefox. Check out the new version, which is much more faster, it uses thin instances. I’ve checked it just right know, it works on Firefox as well. I use Chrome.
Have a nice day!

1 Like

excellent :+1:

1 Like


1 Like