The background objects and the different types of projectiles and obstacles are using InstancedMesh. So each group of objects is rendered with a single draw call.
I’m not using an external library for animation. Everything is updated in the animation loop.
It doesn’t have to be exact, just the principle if you like…for this kind of effect I use tween.js and I’m curious to see how it is done in a loop function
@espace3d The simplest implementation of a tween is something like this:
const animation = {
progress: 0,
duration: 2
}
function update( deltaTime ){
// update the animation progress
// it's a percentage, so will be in the interval [ 0, 1 ]
animation.progress += deltaTime / animation.duration
// make sure we don't overshoot the end of the animation
if ( animation.progress > 1 ) animation.progress = 1
// update whatever it is you're animating
someObject.position.lerpVectors( startPosition, endPosition, animation.progress )
// animation is finished
if ( animation.progress === 1 ){
}
}
Essentially, you’re animating the progress of the animation from 0 to 1, and using that value to control the animated objects.
You can then add some logic to delete the animation when it’s done, add callbacks for the start / end of the animation, add some easing to the animation.progress value when you’re using it to animate in order to make it look more interesting…
Then when you need more complex behaviour you can start developing ways to chain animations together, reverse them, loop them etc.
I’d suggest having a look at gsap, it’s quite a standard library to use and is AFAIK a lot more powerful than Tween.js
Sorry, this is a bit of of scope . I’m not sure how the original developers done it but you could get comparable results by using a particle system with a custom effect.