xxxxxxxxxx
34
let particles = [];
//num of particles
const num = 4000;
//scale factor for noise
const noiseScale = 0.01/2;
function setup() {
createCanvas(600, 600);
//create and initialise particle objects
for (let i = 0; i < num; i++) {
particles.push(new Point(random(width), random(height)));
}
clear();
}
function draw() {
background(0, 10);
stroke('pink');
//loop through all particles
for (let i = 0; i < num; i++) {
let p = particles[i];
//calling the functions declared
p.display();
p.update();
}
}
function mouseReleased() {
//seed noise w millisecond value to create variation
noiseSeed(millis());
}