Particle Systems - Part 1
11 Sep 2021
Particle Systems - Part 1 Introduction In this tutorial, we will create a particle engine for a 2D game. A particle system (or particle engine) is a technique that is used to simulate many effects including fire, sparks, flowing water, falling snow, dust, or abstract effects, like glowing trails or effects from a magic spell. You can really do a lot with a particle system. Often, they are done in 3D, but for this tutorial, we will look at how to implement one in 2D.
Particle Systems - Part 2
11 Sep 2021
Particle Systems - Part 2 Anatomy of a Particle System The next thing we want to do is discuss a little bit about how particle systems work. A particle system has three major components: particles, a particle emitter, and the system itself. A particle is a small point in your game that will be drawn with an image. A particle often has a position in the game world, as well as a velocity, an angle that it is rotated at, an angular velocity which indicates how quickly the particle is spinning, and usually a color and texture for drawing.
Particle Systems - Part 3
11 Sep 2021
Particle Systems - Part 3 The ParticleSystem Class We now want to repeat what we did when we made our Particle class to create a ParticleSystem class. Like before, right-click on your project in the Solution Explorer, and choose Add > New Item from the popup menu. The Add New Item dialog will appear. Select the Class template, and change the name (near the bottom) to ParticleSystem.cs. Click on the Add button when you have done this.
Particle Systems - Part 4
11 Sep 2021
Particle Systems - Part 4 Using our Particle System We are now ready to use our particle system in our game. With the work we’ve done in the previous parts of this tutorial, this will be pretty simple to do. There are several things we will need to add to the main game class to use the particle system, which are discussed here in the final section of this tutorial.