diff --git a/src/gamelib.js b/src/gamelib.js index 90e0e72..bef5335 100644 --- a/src/gamelib.js +++ b/src/gamelib.js @@ -9,7 +9,7 @@ export class Gamelib { this.canvas.width = this.width; this.canvas.height = this.height; this.cx = this.canvas.getContext("2d"); - this.cx.imageSmootingEnabled = false; + this.cx.imageSmoothingEnabled = false; this.loopInterval = null; this.keysPressed = new Set(); @@ -147,7 +147,8 @@ export class Gamelib { image.onload = () => { const sprite = this.spriteCache.get(spriteId); const spriteCx = sprite.getContext("2d"); - spriteCx.drawImage(image, 0, 0); + spriteCx.imageSmoothingEnabled = false; + spriteCx.drawImage(image, 0, 0, width, height); const invalidatedKeys = this.spriteCache.keys() .filter((key) => key.startsWith(`${spriteId}r`));