projectile more realistic fall curve

game-mechanics
Fabien Benetou 2 years ago
parent 63d05ef64d
commit 7c083e4423
  1. 2
      index.html

@ -3068,7 +3068,7 @@ function shoot(){
shot = setInterval( _ => {
d+=.1;
r.at(d, t);
t.y-=.1*(1+d) // simulating gravity and friction
t.y-=.1*(1+d*d) // simulating gravity and friction
s.setAttribute("position", AFRAME.utils.coordinates.stringify( t ));
if (d>100 || t.y < 0) clearInterval(shot)
}, 10)

Loading…
Cancel
Save