Files
processing4/java/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde
2011-12-15 17:27:25 +00:00

26 lines
436 B
Plaintext

/**
* Simple Particle System
* by Daniel Shiffman.
*
* Particles are generated each cycle through draw(),
* fall with gravity and fade out over time
* A ParticleSystem object manages a variable size (ArrayList)
* list of particles.
*/
ParticleSystem ps;
void setup() {
size(640,360);
smooth();
ps = new ParticleSystem(new PVector(width/2,50));
}
void draw() {
background(0);
ps.addParticle();
ps.run();
}