From cd83ca3058dac4caa8bb214a244fa45fbb75488c Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Fri, 29 Dec 2023 00:01:33 +0000 Subject: Simplified render, use a back buffer So we only scale once. --- js/mygame.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'js/mygame.js') diff --git a/js/mygame.js b/js/mygame.js index 6293150..bd5b498 100644 --- a/js/mygame.js +++ b/js/mygame.js @@ -4,9 +4,7 @@ const min = Math.min; class MyGame extends Game { constructor(canvas) { - super(canvas); - this.width = 320; - this.height = 240; + super(canvas, 320, 240); this.data = { sound: "snd/test.ogg", @@ -25,8 +23,6 @@ class MyGame extends Game { } draw() { - this.drawStart(); - /* draw an image */ this.ctx.drawImage(this.res.player, 0, 0); @@ -34,7 +30,5 @@ class MyGame extends Game { if (this.keys["a"]) { this.playSnd(this.res.sound); } - - this.drawEnd(); } } -- cgit v1.2.3