Up-in-the-Air – commitdiff

You can use Git to clone the repository via the web URL. Download snapshot (zip)
Sunset gets preserved through graphics settings changes
authorJulian Fietkau <git@fietkau.software>
Tue, 24 Sep 2024 16:31:37 +0000 (18:31 +0200)
committerJulian Fietkau <git@fietkau.software>
Tue, 24 Sep 2024 16:31:37 +0000 (18:31 +0200)
main.js

diff --git a/main.js b/main.js
index e64028c9aebd5814e4d751172bf0453e9237ca9b..0b5e47ab4fc1b6385fb4239d50125d155996a640 100644 (file)
--- a/main.js
+++ b/main.js
@@ -766,7 +766,11 @@ function createMeshes(game) {
         game.view.materials['cloud' + i].uniforms.texture1.value = game.assets.textures['cloud' + i + 'a'];
         game.view.materials['cloud' + i].uniforms.texture2.value = game.assets.textures['cloud' + i + 'b'];
         game.view.materials['cloud' + i].uniforms.texture3.value = game.assets.textures['cloud' + i + 'c'];
-        game.view.materials['cloud' + i].uniforms.lerp.value = 0.0;
+        if(game.ui.reachedEnd) {
+          game.view.materials['cloud' + i].uniforms.lerp.value = 2.0;
+        } else {
+          game.view.materials['cloud' + i].uniforms.lerp.value = 0.0;
+        }
         game.view.materials['cloud' + i].transparent = true;
       } else {
         for(let variant of ['a', 'b', 'c']) {
@@ -782,7 +786,11 @@ function createMeshes(game) {
     game.objects.clouds = new THREE.Group();
     let textureVariantSuffix = '';
     if(game.settings['graphics'] > 2) {
-      textureVariantSuffix = 'a';
+      if(game.ui.reachedEnd) {
+        textureVariantSuffix = 'c';
+      } else {
+        textureVariantSuffix = 'a';
+      }
     }
     if(game.settings['graphics'] <= 2) {
       let numClouds = 300;
@@ -818,7 +826,7 @@ function createMeshes(game) {
         for(let step of axis) {
           let shape = 1 + Math.floor(Math.random() * 5);
           let cloud = new THREE.Mesh(cloudGeometry, game.view.materials['cloud' + shape + textureVariantSuffix]);
-          cloud.position.x = cameraX + step * maxCameraDistance * Math.sin(angle);
+          cloud.position.x = cameraX + step * 1.2 * maxCameraDistance * Math.sin(angle);
           cloud.position.y = cameraY + step * maxCameraDistance * Math.cos(angle);
           cloud.position.z = z;
           let scale = 15 + 0.5 * Math.abs(cloud.position.z);