Skip to content
Snippets Groups Projects
Commit 0e8f8a86 authored by Bye's avatar Bye
Browse files

better camera

parent e39341a6
Branches
No related tags found
No related merge requests found
Subproject commit 34d196b67f14040db020862d858b8e448ff639e3
Subproject commit e0227fba7aae15c8482dbed73947bb62c2350a48
......@@ -10,11 +10,11 @@ export default class Player extends Entity {
draw() {
canvas.setFillColor('red');
const timeSinceLastFrame = (performance.now() - engine.lastPhysicsFrame) / 1000 / (query.get('slowdown') ? 60 : 1);
const interpolationX = this.vx * timeSinceLastFrame;
const interpolationY = this.vy * timeSinceLastFrame;
// const timeSinceLastFrame = (performance.now() - engine.lastPhysicsFrame) / 1000 / (query.get('slowdown') ? 60 : 1);
// const interpolationX = this.vx * timeSinceLastFrame;
// const interpolationY = this.vy * timeSinceLastFrame;
// const interpolationX = 0;
// const interpolationY = 0;
canvas.fillRect(roundToRatio(this.x+interpolationX),roundToRatio(this.y+interpolationY),this.width,this.height);
canvas.fillRect(roundToRatio(this.x),roundToRatio(this.y),this.width,this.height);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment