diff --git a/src/scene.js b/src/scene.js index 569d49b..50523fb 100644 --- a/src/scene.js +++ b/src/scene.js @@ -20,6 +20,10 @@ class Scene extends Screen { }); } + updateCameraSpeed(height) { + this.cameraSpeed = 0.0005 + (height / 200) * 0.0001; + } + get maxHeight() { return window.localStorage.getItem("maxHeight"); } @@ -194,6 +198,10 @@ class Scene extends Screen { // Update coin frames this.collectables.map((c) => c.update(time)); + + if (this.started) { + this.updateCameraSpeed(heightToScore(this.currentHeight)); + } } addPlatform(object) {