marble finish animation match to original

This commit is contained in:
RandomityGuy 2022-12-17 14:16:19 +05:30
parent 0c50e7f037
commit 9e1240fc44

View file

@ -490,6 +490,8 @@ class Marble extends GameObject {
var A = new Vector(); var A = new Vector();
if (this.mode != Finish) if (this.mode != Finish)
A = gWorkGravityDir.multiply(this._gravity); A = gWorkGravityDir.multiply(this._gravity);
if (this.mode == Finish)
A = this.velocity.multiply(-16);
if (currentTime - this.helicopterEnableTime < 5) { if (currentTime - this.helicopterEnableTime < 5) {
A = A.multiply(0.25); A = A.multiply(0.25);
} }
@ -1503,9 +1505,9 @@ class Marble extends GameObject {
} }
} }
if (mode == Finish) { // if (mode == Finish) {
this.velocity = this.velocity.multiply(0.925); // this.velocity = this.velocity.multiply(0.925);
} // }
var newPos = pos.add(this.velocity.multiply(timeStep)); var newPos = pos.add(this.velocity.multiply(timeStep));
newPos = nudgeToContacts(newPos, _radius); newPos = nudgeToContacts(newPos, _radius);