xxxxxxxxxx
//tempo
let t, dt;
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
t = 0;
dt = 1.5;
p1 = new Particella(width/2, height/2, 0.03, -0.07, 0.01, 0.008, 20);
p2 = new Particella(0, 1.2, 0, -0.1, 0.003, 0.022, 50);
p3 = new Particella(200, 300, 0.001, - 0.02, 0.15, 0.01, 30);
}
function draw() {
background(9, 7, 51);
textSize(10);
text("tempo: " + t, 10, 25);
p1.disegna();
p2.disegna();
p3.disegna();
p1.muovi(dt);
p2.muovi(dt);
p3.muovi(dt);
p1.bordi();
p2.bordi();
p3.bordi();
t = t + dt-2;
}