Skip to content

Commit

Permalink
fix camera stuttering on following on size sprite
Browse files Browse the repository at this point in the history
  • Loading branch information
jwunderl committed Dec 14, 2023
1 parent cf910a5 commit 0020199
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/game/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ namespace scene {
if (this.sprite) {
this._lastUpdatedSpriteX = this.sprite.x;
this._lastUpdatedSpriteY = this.sprite.y;
this.offsetX = this.sprite.x - (screen.width >> 1);
this.offsetY = this.sprite.y - (screen.height >> 1);
this.offsetX = this.sprite.left + (this.sprite.width >> 1) - (screen.width >> 1);
this.offsetY = this.sprite.top + (this.sprite.width >> 1) - (screen.height >> 1);
}

this.drawOffsetX = this.offsetX;
Expand Down

0 comments on commit 0020199

Please sign in to comment.