diff --git a/src/scene.js b/src/scene.js index af20526..cc13a3e 100644 --- a/src/scene.js +++ b/src/scene.js @@ -177,6 +177,17 @@ class Scene extends Screen { this.context.lineTo(this.width(), height); this.context.stroke(); + this.context.save(); + this.context.translate(0, height); + + let pattern = this.context.createPattern(Scene.highscore, 'repeat'); + this.context.fillStyle = pattern; + this.context.beginPath(); + this.context.rect(0, 0, this.width(), 32); + this.context.fill(); + + this.context.restore(); + this.context.font = "15px Arial"; this.context.fillStyle = "rgb(255, 255, 255)"; this.context.fillText("High score: " + Math.floor(100 * this.currentMaxHeight), 0, height - 5); @@ -298,3 +309,6 @@ class Scene extends Screen { Scene.background = new Image(); Scene.background.src = "img/background.png"; + +Scene.highscore = new Image(); +Scene.highscore.src = "img/highscore.png";