Second episode of Made with Duality! This time, get ready for some shocking action…

Thunderball

This second piece, called Thunderball (in case it was not clear yet :D) consists of a Ball, a Repulsor (the red sparkly thingy), and a Attractor (the green one). The goal of this scene was to toy around with physics and lightning generators; might be some kind of very, very early game concept?

Opposed to the first episode, where the scene was pretty nice to see but quite poor in terms of stuff going on, this time there are more things moving around, and a little less eye-candy.

In particular, the ball interacts with both repulsor and attractor as follows: if the ball is near enough (i.e. its distance is less than a configured threshold) to either the repulsor or the attractor, it will get, respectively, pushed away or towards the corresponding entity with a strength proportional to the inverse of the distance (the closer, the stronger the effect will be). In case the ball is near to both, only the closer one will apply its effects.

To do this, I created a custom component in charge of verifying the distances, alter the LinearVelocity of the ball when needed, and, in a second time, I decided to add a soundFX when hitting the border of the game area. Said game area, like in the Breakout tutorial, is made by simply encircling the colored screen with invisible Static RigidBodies.

Both the repulsor and the attractor use a Particle Emitter with different settings in order to show where they are; in addition they also contain a RigidBody like the ball to be able to bounce around the game area.

The ball instead, includes a Lightning emitter whose target and color are changed in real time, depending on the fact that is under the effects of the repulsor or the attractor.

This time it took around 4 hours to have everything together and working as expected, plus another 4 hours of tuning (but in that case, it was more like 5 minutes playing around with settings and 10 minutes watching it moving around).

This is what it looks like, but of course a picture is not enough this time…

… so if you want to see how it looks in motion, just download it here and check it out!

Credits

Here the full list of the assets used:

   
Sound PongBlipF4.wav by NoiseCollector @freesound
   

Nothing else.. all the other assets are either part of the Duality engine (the Duality logo used as the ball texture), made by me (the line texture used by the particle emitters) or procedurally generated (the lightning bolts).

Final words

Again, that’s all. If you have questions, comments, or simply would like the full Scene project, just leave me a message in the Contact section, or drop a line in the MWD’s topic on Duality’s forums.