Dev Diary - Barnstorming Remake: Particle Effects

In the game, there are 2 particle effects. The first being the smoke coming out of the exhaust, and the second being the one when the car collides with an obsticale.

I really don't like the look of the default particle texture, so I changed it to the sprite default one. This makes white, square particles which in my opinion fit well with a low poly game.

The exhaust particle effect simply emits particles backwards, with them being a mix between light grey and dark grey. They fade out over time and have some random movement along the x and y axis. Also, there is a gravity modifier, moving the particles up into the air and a rotation applied to the particles.

One cool thing though, is that the rate of emission is tied to the car's horizontal velocity. The formula to calculate that is:

rate = Mathf.Pow(rig.velocity.x / 2, 3)

This is an exponential curve which increases quite a bit as the speed increases.

When the player collides with an object, along with bouncing back a sound and particle effect is played. The particle effect is quite important as it provides the player with visual feedback and makes the world seem whole. When you hit something like a log, you'd expect there to be a puff of dirt, wood particles and smoke. 

This particle was made in a similar way to the smoke one, just with the particles emitting from a sphere and disappearing quite quickly. I didn't want to clutter the screen with the particles sitting around for a while as even a small duration of them tells the player what they need to know.

In deciding what colour to make the particle I was a bit stuck. The player can hit both fallen trees and gas station colliders. Both are different colours. So I decided to go with a similar colour to the ground. It looks like a dust cloud and is much easier than figuring out what the player hit, then changing the patrticle colour based on that.