xxxxxxxxxx
//tempo
let t, dt;
function setup() {
createCanvas(windowWidth, windowHeight);
t = 0;
dt = 0.5;
//creazioned ell'oggetto particella
//--> p = new Particella(x, y, vx, vy, r);
p = new Particella(width/2, height/2, 1.2, -2.7, 20);
p2 = new Particella (200, 300, -2.3, 1.5, 15)
}
function draw() {
background(0, 255, 229);
fill (0, 150, 200);
textSize(15);
text("tempo: " + t, 10, 25);
p.bordi();
p.muovi(dt);
p.disegna();
p2.bordi();
p2.muovi(dt);
p2.disegna();
t += dt;
}