xxxxxxxxxx
//tempo
let t, dt;
function setup() {
createCanvas(windowWidth, windowHeight);
t = 0;
dt = 0.5;
//creazione dell'oggetto particella
p = new Particella(width/2, height/2, 1.2, -2.7, 20);
p2= new Particella(200, 300, -2.1, 1.5, 15);
}
function draw() {
background(100);
fill(0, 255, 0);
textSize(15);
text("tempo: " + t, 10, 25);
p.bordi();
p.muovi(dt);
p.disegna();
p2.bordi();
p2.muovi();
p2.disegna();
t += dt;
}