   2D Special Effects with a Particle System
  After studying 2D special affects and particle systems, I came up with a class called ParticleSystem. Below is the code for ParticleSystem, as well as derived class FireEffect. Here is an example program using these classes. The API used for graphics is Allegro and the fblend add-on library.I'm afraid the design will prevent me from creating advanced effects like clouds and wormholes (I know nothing about these). How can I improve upon this design? Thanks for your help.particle2d.h////////////////////////////////////////////////////////////*    Filename:particle2d.h    Description:2D particle system*//////////////////////////////////////////////////////////////#ifndef PARTICLE2D_H#define PARTICLE2D_H////  Header Files  ///////////////////////////////////////////#include "allegro.h"#include "vector2d.h" // personal Vector2D struct and functions////  Structs  ////////////////////////////////////////////////struct Particle2D{Vector2D pos;Vector2D vel;int color;int life;int alpha;};////  Base Classes  ///////////////////////////////////////////class ParticleSystem{public:ParticleSystem(Vector2D position, int particles);virtual ~ParticleSystem();void setPos(Vector2D position);// Set emitter positionvirtual void reset() = 0;virtual void update() = 0;virtual void draw(BITMAP *bmp) = 0;// Core functionalityprotected:Vector2D pos;  // Position of emitterParticle2D *p; // Array of Particle2D'sint size; // Number of items in array};////  Derived Classes  ////////////////////////////////////////class FireEffect : public ParticleSystem{public:FireEffect(Vector2D position, int particles) : ParticleSystem(position, particles) { reset(); }void reset();void update();void draw(BITMAP *bmp);private:void reset(Particle2D &particle);// Reset individual particles};///////////////////////////////////////////////////////////////#endif//particle2d.cpp////////////////////////////////////////////////////////////*    Filename:particle2d.cpp    Description:2D particle system*///  Header Files  ///////////////////////////////////////////#include "particle2d.h"#include "allegro.h"#include "vector2d.h"#include "common.h"#include "fblend.h"////  ParticleSystem  /////////////////////////////////////////ParticleSystem::ParticleSystem(Vector2D position, int particles){pos  = position;size = particles;p = new Particle2D[particles];}ParticleSystem::~ParticleSystem(){delete [] p;}void ParticleSystem::setPos(Vector2D position){pos = position;}////  FireEffect  /////////////////////////////////////////////void FireEffect::reset(){int i;for (i = 0; i < size; i++){reset(p);}}void FireEffect::update(){int i;for (i = 0; i < size; i++){// Resurrect particles if deadif (p.life < 0){reset(p);}// Update positionp.pos += p.vel;// Change color attributesp.color = makecol(255, 50+(p.life/50.0*200), 0);p.alpha -= 5;// Life is short :(p.life--;}}void FireEffect::draw(BITMAP *bmp){int i;for (i = 0; i < size; i++){fblend_rect_trans(bmp, p.pos.x, p.pos.y, p.life/50.0*4, p.life/50.0*4, p.color, p.alpha);}}void FireEffect::reset(Particle2D &particle){particle.pos   = Vector2D( random(pos.x-2, pos.x+2), random(pos.y-2, pos.y+2) );particle.vel   = Vector2D( randomSign() * random(0, 10)/10.0, randomSign() * random(0, 10)/10.0 );particle.color = makecol(255, 255, 0);particle.life  = random(20, 50);particle.alpha = 255;}//