Click and/or drag the mouse and see what happens. The V key changes the overall viscosity, and the C key changes the colour of any new particles.
A fork of Jelly Sim by Richard Bourne
xxxxxxxxxx
var particles = [];
var viscosity;
var c;
function setup() {
createCanvas(1112, 834);
frameRate(60);
noStroke();
colorMode(HSB, 255);
viscosity = 0.95;
}
function draw() {
background(32);
c = color(random(255), 200, 255, 192);
// makes the particles attract/repel each other
handleInteractions();
// moves each particle, then draws it
for (var i = 0; i < particles.length; i++) {
particles[i].move();
particles[i].display();
}
}