Up-in-the-Air – commitdiff

You can use Git to clone the repository via the web URL. Download snapshot (zip)
Bugfix: Letters are visible during the ending cutscene again
authorJulian Fietkau <git@fietkau.software>
Wed, 25 Sep 2024 01:29:05 +0000 (03:29 +0200)
committerJulian Fietkau <git@fietkau.software>
Wed, 25 Sep 2024 01:29:05 +0000 (03:29 +0200)
main.js

diff --git a/main.js b/main.js
index a0795d7b659ae218cf977cd4798d2a34c981fe8d..669caa7f18079f20e04fa052b41d858dbe91389c 100644 (file)
--- a/main.js
+++ b/main.js
@@ -399,34 +399,36 @@ function animate(game, renderer, scene) {
       game.objects.feather.position.setY(-game.courseRadius - 5.4 * Math.min(1, easeInOut(1 - Math.max(0, 4 - game.timeProgress) / 4)));
       game.objects.feather.position.setZ(-6.6 * Math.min(1, easeInOut(1 - Math.max(0, 4 - game.timeProgress) / 4)));
       game.objects.pinwheel.material[4].opacity = easeInOut(Math.max(0, (1 - game.timeProgress)));
-      let letterScale = lerp(0.3, 0.0, easeInOut(Math.max(0, Math.min(1, game.timeProgress - 6))));
-      for(let i = 0; i < game.objects.words.length; i++) {
-        let word = game.objects.words[i];
-        if(!word.collected) {
-          continue;
-        }
-        let x, y, z;
-        let collectionAnimationDuration = 1.0;
-        for(let j = 0; j < word.children.length; j++) {
-          let letter = word.children[j];
-          let animationProgress = (((game.timeProgress + 5 * word.randomAnimOffset) % 5) / 5 + j / 37) % 1;
-          x = game.objects.feather.scale.x * 0.5 * Math.cos(animationProgress * 1 * Math.PI * 2);
-          y = 0.2 * Math.sin(animationProgress * 7 * Math.PI * 2);
-          z = 0.2 * Math.cos(animationProgress * 7 * Math.PI * 2);
-          x = x * Math.cos(game.objects.feather.rotation.z) - y * Math.sin(game.objects.feather.rotation.z);
-          y = y * Math.cos(game.objects.feather.rotation.z) + x * Math.sin(game.objects.feather.rotation.z);
-          x += game.objects.feather.position.x;
-          y += game.objects.feather.position.y;
-          z += game.objects.feather.position.z;
-          if(i == 0 && !word.collected) {
-            // If we don't catch this edge case here, the manually placed first word might be visible
-            // in the closing cutscene if it is not collected.
-            x = 9999;
+      if(!game.settings['highcontrast']) {
+        let letterScale = lerp(0.3, 0.0, easeInOut(Math.max(0, Math.min(1, game.timeProgress - 6))));
+        for(let i = 0; i < game.objects.words.length; i++) {
+          let word = game.objects.words[i];
+          if(!word.collected) {
+            continue;
+          }
+          let x, y, z;
+          let collectionAnimationDuration = 1.0;
+          for(let j = 0; j < word.children.length; j++) {
+            let letter = word.children[j];
+            let animationProgress = (((game.timeProgress + 5 * word.randomAnimOffset) % 5) / 5 + j / 37) % 1;
+            x = game.objects.feather.scale.x * 0.5 * Math.cos(animationProgress * 1 * Math.PI * 2);
+            y = 0.2 * Math.sin(animationProgress * 7 * Math.PI * 2);
+            z = 0.2 * Math.cos(animationProgress * 7 * Math.PI * 2);
+            x = x * Math.cos(game.objects.feather.rotation.z) - y * Math.sin(game.objects.feather.rotation.z);
+            y = y * Math.cos(game.objects.feather.rotation.z) + x * Math.sin(game.objects.feather.rotation.z);
+            x += game.objects.feather.position.x - word.position.x;
+            y += game.objects.feather.position.y - word.position.y;
+            z += game.objects.feather.position.z - word.position.z;
+            if(i == 0 && !word.collected) {
+              // If we don't catch this edge case here, the manually placed first word might be visible
+              // in the closing cutscene if it is not collected.
+              x = 9999;
+            }
+            letter.position.set(x, y, z);
+            let rotation = (game.timeProgress * 3) % (2 * Math.PI);
+            letter.rotation.set(rotation + j, rotation + 2*j, rotation + 3*j);
+            letter.scale.set(letterScale, letterScale, letterScale);
           }
-          letter.position.set(x, y, z);
-          let rotation = (game.timeProgress * 3) % (2 * Math.PI);
-          letter.rotation.set(rotation + j, rotation + 2*j, rotation + 3*j);
-          letter.scale.set(letterScale, letterScale, letterScale);
         }
       }
       if(game.timeProgress >= 8) {