Reduce, reuse, and recycle. In part three we’ll be optimizing our engine by recycling particles to avoid allocation and garbage collection. So let’s get started!
First things first, what exactly is a particle engine? A particle engine (or particle system) is a common way to create and render graphical effects, such as: fire, smoke, explosions, magical effects, etc. For a visual, check out this very cool example by Reuben Carter.
In this tutorial we’ll be developing a 2D particle system that can be used to create an unlimited number of effects for your XNA game. We’ll start with a very simple system, and then in following posts expand to create an external library which can easily be included into future projects. So let’s jump in!