this.up = function () {
this.velocity += this.lift * deltaTime;
};
this.update = function () {
this.velocity += this.gravity * deltaTime;
this.velocity *= 0.9;
this.y += this.velocity;
}
Hi, I have a 2d game on canvas using p5 js thats basically like flappy bird . But Im trying to use deltaTime so the movement is the same regardless of fps.
Does anyone know how I'd apply deltaTime to keep the movement consistent across all fps?
I think it has something to do with the velocity being reduced by 0.9 but Im not sure how to apply delta to that part. Help would be appreciated