Thursday 5 January 2012

Making use of particles for explosions

So far when I collide with a building. Nothing happens other than the player UFO bounces off.

I've added some quick code to make the player disapper and reset position.

But it would be nice to have a cool explosion. Well these new particles will work nicely.

Firstly I've created a wrapper class to contain the particle effects and then I can just pass this to my player object and upon collision just add the explosion particle to the game world.

Very easy to implement and now when I crash there is a satisfying explosion.

I decided to add another particle effect too for when you thrust the player UFO it now has an emission trail shoot out of the bottom.

All I did was copy the fire particle system and tweak it with a new graphic to get my desired effect.

This is kind of a distraction from getting my core game done but it was a fun experience and has added a nice polish to the game.

No comments:

Post a Comment