Skip to content

Instantly share code, notes, and snippets.

@rformato
Forked from anonymous/createParticles.js
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save rformato/9162196 to your computer and use it in GitHub Desktop.

Select an option

Save rformato/9162196 to your computer and use it in GitHub Desktop.
var creaParticelle = function() {
var x,y = hc/2;
for(var i=0;i<numParticelle;i++) {
x = Math.random()*wc;
part[i] = new Particella(x,y, Math.random()*5.5+0.5, colori[Math.round(Math.random()*(numColori-1))]);
part[i].setRif(x,y);
}
}
var setup = function() {
creaParticelle();
c.clearRect(0, 0, wc, hc);
c.fillStyle = "#1B2209"
c.fillRect(0, 0, wc, hc);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment