diff --git a/src/js/scene.js b/src/js/scene.js index fcd03cd..f2d53e6 100644 --- a/src/js/scene.js +++ b/src/js/scene.js @@ -12,9 +12,13 @@ export class Scene { this.setScreenSize(width, height); } + #clearCanvas() { + this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); + } + run() { // clear canvas - this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); + this.#clearCanvas(); // fill canvas this.context.fillStyle = '#523c4e';