Represents a batch of particles of the same "type".
float m_radius
the radius of an individual particle
void draw(SpriteBatch &batch) const
draws all the particles
int m_textureID
texture used by the particles
int getFreeParticle() const
returns index of particle with the minimum life
Represents a simple 2d particle.
int m_maxParticles
maximum number of particles allowed
float m_decayRate
the rate with which particles lose life
void addParticle(Particle2D p)
adds a particle to the batch
std::function< void(Particle2D &, float)> m_updateFunction
the function used to update the particles
float m_initialLife
the life every particle starts out with
void init(float il, float dr, float r, int mp, int tex, std::function< void(Particle2D &, float)> updateFunc)
initializes particle batch by specifying properties