Anybody for a quick way of killing particles?

Hi there,
can anybody suggest a quick way of killing particles?

I am stuck with my particle system and am looking for a final touch, at the moment everything works apart from the fact that I cannot kill the particles and they are overpopulating the scene.

Here is my code in testApp.cpp
It is a particle system that is reacting to sound, hence the scaledVol value.
I am sure it is an easy question, I am just getting to know OF better.

////--------------------------------------------------------------
void testApp::update(){

for(int i = 0; i < 2.77; i++){
particles.push_back(Particle(ofGetScreenWidth()/2,ofRandomHeight(),particleImage));
}

for(int i =0; i < particles.size(); i++){
particles[i].update(scaledVol*190.0f);

}

Many thanks everyone!

Best

Faeviuz

particles.clear(); will empty the particles vector

  
  
for(int i=0; i<particles.size(); i++)  
{  
//assuming your Particle class has a .y value, remove the ones below half the screen  
	if(particles[i].y > ofGetHeight()/2)  
	{  
		particles.erase(particles.begin()+i);  
	}  
}  
  

Thanks!!!
looking much better now!!!

Faeviuz