Particle system in C++