pour has a simple and straightforward API and embraces prototypal programming, keeping it below 4kb (minified). In addition, it supports both browser- and node-based environments. pour is licensed under the MIT license.
Let's simulate the path of a particle being attracted by a field.
To begin, we set up an empty particle system. A
System holds all
var system = pour; // shorthand for `new pour.System()`
We also set up an
Emitter that emits
Particles and add it to our
var emitter = pour;system;
Everytime we call
Emitter emits a new
var particle = emitter;
If we add the
Particle to the
System, we can compute its path by calling
system.tick(). Each call to
tick simulates one atomic step. All
Particles will then move according to their current
system;system; // one step further…
By adding a
Field, we can influence all
Particles in our
System. A positive
mass of a
Field will attract them, a negative will repulse them.
field = pour;system;system;
If you have a question, found a bug or want to propose a feature, have a look at the issues page.