Particle Code
Particle system code has three major parts:
Create new particles. Assign them some initial state.
Update the particles. Move them; remove those whose time limit is reached.
Render the particles.