April 2017
Beginner to intermediate
394 pages
9h 16m
English
Let's add a new type of particle system in addition to our current one that doesn't move. Let's call it Moving and our previous one, Static. To differentiate between the two, let's add an enum:
enum ParticleType { PS_Static, PS_Moving };
We can now modify the original ParticleComponent class, by removing the previously created variables and instead including a reference to the kind of ParticleSystem we wish to use:
class ParticleComponent : public M5Component { public: ParticleComponent(); virtual void Update(float dt); virtual M5Component* Clone(void); virtual void FromFile(M5IniFile& iniFile); bool activated; float lifeLeft; private: ParticleType particleType; };
The ParticleComponent class ...
Read now
Unlock full access