Skip to content

Instantly share code, notes, and snippets.

@pandr
Created November 9, 2017 06:43
Show Gist options
  • Save pandr/e7a050a7fe55a683f145e5a151b178dc to your computer and use it in GitHub Desktop.
Save pandr/e7a050a7fe55a683f145e5a151b178dc to your computer and use it in GitHub Desktop.
var blob = [];
function setup()
{
createCanvas(800, 400);
background(128);
fill(100,12,12);
noStroke(); }
function draw() { if(mouseIsPressed)
{
blob.push([mouseX,mouseY,random(15,20),random(0.2,3),100]); }
var i = 0; while(i < blob.length) {
if(blob[i][2]>3)
{ fill(blob[i][4],12,12,+blob[i][2]*10);
ellipse(blob[i][0],blob[i][1],blob[i][2]);
blob[i][1] += random(0.1,1.5);
blob[i][0] += random(-0.5,.5);
blob[i][2] -= blob[i][3];
blob[i][3] *= 1.01;
blob[i][4] -= 0.6;
} i++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment