xxxxxxxxxx
//tempo e variazione di tempo
let t, dt;
//centro di gravità
let gx, gy;
//costante di gravitazione universale
let G = 1000
function setup() {
createCanvas(windowWidth, windowHeight);
t = 0;
dt = 2;
gx = width /2
gy = width /2
//creazione oggetto
p = new Particella(width/2, height/2-100, 0.3, 0, 20, 0, 0.);
q = new Particella(200, 300, 0, -0.5, 15, 0, 0.0);
}
function draw() {
background(255);
timer();
//p.edges();
p.move(dt);
p.object();
//q.edges();
q.move(dt);
q.object();
t += dt;
}
//funzionamento del timer
function timer(){
textSize(15)
fill(0, 255, 0)
text("tempo: " + t, 10, 25);
}