Up-in-the-Air – commitdiff

You can use Git to clone the repository via the web URL. Download snapshot (zip)
Bugfix: keep camera sway in options and credits
authorJulian Fietkau <git@fietkau.software>
Mon, 30 Sep 2024 20:09:52 +0000 (22:09 +0200)
committerJulian Fietkau <git@fietkau.software>
Mon, 30 Sep 2024 20:09:52 +0000 (22:09 +0200)
main.js

diff --git a/main.js b/main.js
index eda032a9f49131fd31e53f4917266e7995b402a9..974dfa8f8cf520724306ba7058657668077e1fdb 100644 (file)
--- a/main.js
+++ b/main.js
@@ -749,6 +749,10 @@ game['fn'].animate = (scene) => {
       cameraSwayFactor = 0;
     }
     let cameraX, cameraY;
+    if(['options', 'credits'].includes(game.ui.currentPage)) {
+      cameraX = game.ui.reachedEnd ? 5 : -5;
+      cameraY = 0;
+    }
     if(game.ui.currentPage == 'title') {
       cameraX = -5;
       cameraY = 0;