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 scaleY = 2.5 rot = 0 rotVel = 0 components = GfxComponent ParticleComponent [GfxComponent] texture = particle.tga drawSpace = world
After that, we need the Mach5 engine to support our new object, so go to the EngineTest
folder and then...