mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 11:21:06 +01:00
28 lines
500 B
Plaintext
28 lines
500 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);
|
|
colorMode(RGB, 255, 255, 255, 100);
|
|
ps = new ParticleSystem(1, new PVector(width/2,height/2,0));
|
|
smooth();
|
|
}
|
|
|
|
void draw() {
|
|
background(0);
|
|
ps.run();
|
|
ps.addParticle(mouseX,mouseY);
|
|
}
|
|
|
|
|
|
|