Implementing particles in Mach5

Now that we know what particles are, let's put them into Mach5 so we can get an example of how they work. We will be creating particles to follow our ship while it moves in a similar fashion to a smoke trail. This will be a great way to show an example of particles on the screen but, to have something to show, we will first need to bring a new archetype into the game.

To do that, open up the Example Code folder for this chapter and bring the particle.tga file into the EngineTest/Textures folder of your Visual Studio project.

After that, open up the EngineTest/ArcheTypes folder, create a new text file called Particle.ini, and fill it with the following info:

posX   = 0 posY   = 0 velX   = 0 velY   = 0 scaleX = 2.5 ...

Get Game Development Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.