Increase camera speed when time goes by

This commit is contained in:
Thomas Forgione 2018-08-27 14:41:29 +02:00
parent 6b5df53e3f
commit 3ca4681a74
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
1 changed files with 8 additions and 0 deletions

View File

@ -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) {