From 06b651da9172d89d18b333bc1a9921add8be4b88 Mon Sep 17 00:00:00 2001 From: bye <bye@byecorps.com> Date: Sat, 31 Aug 2024 17:31:42 +0100 Subject: [PATCH] Smooth camera --- hampsterengine | 2 +- src/js/objects/ground.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hampsterengine b/hampsterengine index e0227fb..04ed5f0 160000 --- a/hampsterengine +++ b/hampsterengine @@ -1 +1 @@ -Subproject commit e0227fba7aae15c8482dbed73947bb62c2350a48 +Subproject commit 04ed5f0a25ca36462ce82704d2312881ba099c79 diff --git a/src/js/objects/ground.js b/src/js/objects/ground.js index ffdc25c..c1f5696 100644 --- a/src/js/objects/ground.js +++ b/src/js/objects/ground.js @@ -19,8 +19,8 @@ export default class Ground extends Entity { draw() { if (!(this.surface || this.below)) return; - canvas.tileImage(this.surface, roundToRatio(this.x), roundToRatio(this.y), this.width, 8*this.scale, 8*this.scale, 8*this.scale); - canvas.tileImage(this.below, roundToRatio(this.x), roundToRatio(this.y+8*this.scale), this.width, this.height-8*this.scale, 8*this.scale, 8*this.scale); + canvas.tileImage(this.surface, round(this.x), round (this.y), this.width, 8*this.scale, 8*this.scale, 8*this.scale); + canvas.tileImage(this.below, round(this.x), round(this.y+8*this.scale), this.width, this.height-8*this.scale, 8*this.scale, 8*this.scale); // canvas.fillRect(this.x, this.y, this.width, this.height); } } -- GitLab