Up-in-the-Air – commitdiff

You can use Git to clone the repository via the web URL. Download snapshot (zip)
Final house graphics
authorJulian Fietkau <git@fietkau.software>
Thu, 26 Sep 2024 01:31:05 +0000 (03:31 +0200)
committerJulian Fietkau <git@fietkau.software>
Thu, 26 Sep 2024 01:31:05 +0000 (03:31 +0200)
main.js
textures/house-day-1.png [new file with mode: 0644]
textures/house-day-2.png [new file with mode: 0644]
textures/house-day-3.png [new file with mode: 0644]
textures/house-evening-1.png [new file with mode: 0644]
textures/house-evening-2.png [new file with mode: 0644]
textures/house-evening-3.png [new file with mode: 0644]
textures/windowsill1.png [deleted file]
textures/windowsill2.png [deleted file]

diff --git a/main.js b/main.js
index c4b9f80738892f532fe53363e9469393d0ba3d42..2678c366180c281fa353575afd63f763e3135ddb 100644 (file)
--- a/main.js
+++ b/main.js
@@ -81,8 +81,12 @@ function loadAllAssets(game, renderProgressCallback) {
       'textures/highcontrast-backdrop.png': 500,
       'textures/logo.png': 5174,
       'textures/pinwheel.png': 904,
-      'textures/windowsill1.png': 483119,
-      'textures/windowsill2.png': 484665,
+      'textures/house-day-1.png': 17819,
+      'textures/house-day-2.png': 598,
+      'textures/house-day-3.png': 646,
+      'textures/house-evening-1.png': 16939,
+      'textures/house-evening-2.png': 597,
+      'textures/house-evening-3.png': 646,
     };
     for(let unlockable of ['golden', 'ghost']) {
       if(game.settings['unlocks'].includes(unlockable)) {
@@ -198,24 +202,34 @@ function init(game, canvas) {
   game.objects.pinwheel.opacity = 0;
   scene.add(game.objects.pinwheel);
 
-  const startingWindowsillMaterial = new THREE.MeshBasicMaterial({
-    map: game.assets.textures.windowsill1,
-    transparent: true,
-    alphaTest: 0.5,
-  });
-  game.objects.startingWindowsill = new THREE.Mesh(new THREE.PlaneGeometry(8, 12), startingWindowsillMaterial);
-  game.objects.startingWindowsill.position.set(-10.3, -game.courseRadius - 4, -7);
-  const endingWindowsillMaterial = new THREE.MeshBasicMaterial({
-    map: game.assets.textures.windowsill2,
-    transparent: true,
-    alphaTest: 0.5,
-  });
-  game.objects.endingWindowsill = new THREE.Mesh(new THREE.PlaneGeometry(8, 12), endingWindowsillMaterial);
-  game.objects.endingWindowsill.position.set(
-    -game.objects.startingWindowsill.position.x,
-    game.objects.startingWindowsill.position.y,
-    game.objects.startingWindowsill.position.z
-  );
+  for(let time of ['day', 'evening']) {
+    game.objects[time + 'House'] = new THREE.Group();
+    for(let layer of [1, 2, 3]) {
+      let material = new THREE.MeshBasicMaterial({
+        map: game.assets['textures']['house-' + time + '-' + layer],
+        transparent: true,
+        alphaTest: 0.5,
+      });
+      let dimensions;
+      if(layer == 1) {
+        dimensions = [14, 14, 0, 0, -2];
+      } else if(layer == 2) {
+        dimensions = [6, 3.4455, -1.4, -3.6, -3];
+      } else if(layer == 3) {
+        dimensions = [10, 10, -4, -2, -6];
+      }
+      let mesh = new THREE.Mesh(new THREE.PlaneGeometry(dimensions[0], dimensions[1]), material);
+      mesh.position.set(dimensions[2], dimensions[3], dimensions[4]);
+      if(time == 'evening') {
+        mesh.position.setX(-mesh.position.x);
+      }
+      game.objects[time + 'House'].add(mesh);
+    }
+    game.objects[time + 'House'].position.set(-11.5, -game.courseRadius - 4, -7);
+    if(time == 'evening') {
+      game.objects[time + 'House'].position.x *= -1;
+    }
+  }
 
   game.view.camera.position.set(-5, -game.courseRadius, game.view.camera.position.z);
   game.view.scene = scene;
@@ -364,9 +378,9 @@ function reset(game) {
      game.view.materials['cloud' + i].uniforms.lerp.value = 0.0;
     }
   }
-  game.view.scene.add(game.objects.startingWindowsill);
-  game.view.scene.remove(game.objects.endingWindowsill);
-  game.objects.feather.position.set(-11.45, -game.courseRadius - 4.2, -6.6);
+  game.view.scene.add(game.objects.dayHouse);
+  game.view.scene.remove(game.objects.eveningHouse);
+  game.objects.feather.position.set(-11.45, -game.courseRadius - 4.2, -9.9);
   game.objects.feather.rotation.set(Math.PI, 0, Math.PI / 2.1);
   game.objects.pinwheel.material[4].opacity = 0.0;
   setTimeout(() => {
@@ -476,7 +490,7 @@ function animate(game, renderer, scene) {
     let cameraX = -5;
     if(game.ui.currentPage == 'title') {
       if(!game.ui.reachedEnd) {
-        game.objects.feather.position.set(cameraX - 6.45, -game.courseRadius - 4.2, -6.6);
+        game.objects.feather.position.set(cameraX - 8.45, -game.courseRadius - 6.4, -9.9);
         game.objects.feather.rotation.set(Math.PI, 0, Math.PI / 2.1);
       } else {
         cameraX = 5;
@@ -488,9 +502,9 @@ function animate(game, renderer, scene) {
       cameraSwayFactor = cameraSwayFactor * (1 - (game.timeProgress / 8));
       cameraX = -5 + Math.pow(Math.max(0, game.timeProgress - 3) / 5, 1.6) * 5;
 
-      game.objects.feather.position.setX(-11.45 + 12 * Math.min(1, easeInOut(Math.max(0, game.timeProgress - 4) / 4)));
-      game.objects.feather.position.setY(-game.courseRadius - 4.2 + 4 * Math.min(1, easeInOut(Math.max(0, game.timeProgress - 4) / 4)));
-      game.objects.feather.position.setZ(-6.6 + 6.6 * Math.min(1, easeInOut(Math.max(0, game.timeProgress - 4) / 4)));
+      game.objects.feather.position.setX(cameraX - 8.45 + 12 * Math.min(1, easeInOut(Math.max(0, game.timeProgress - 4) / 4)));
+      game.objects.feather.position.setY(-game.courseRadius - 6.4 + 4 * Math.min(1, easeInOut(Math.max(0, game.timeProgress - 4) / 4)));
+      game.objects.feather.position.setZ(-9.9 + 9.9 * Math.min(1, easeInOut(Math.max(0, game.timeProgress - 4) / 4)));
       if(game.timeProgress > 6 && game.timeProgress < 7) {
         game.controls.positionX = 0;
         game.controls.positionY = -3;
@@ -504,10 +518,11 @@ function animate(game, renderer, scene) {
     } else if(game.ui.currentPage == 'endingcutscene') {
       cameraSwayFactor = cameraSwayFactor * game.timeProgress / 8;
       cameraX = 5 - Math.pow(Math.max(0, 5 - game.timeProgress) / 5, 1.6) * 5;
+      game.objects.feather.rotation.x = -0.2;
       game.objects.feather.rotation.z = -0.2;
-      game.objects.feather.position.setX(10.5 * Math.min(1, easeInOut(1 - Math.max(0, 4 - game.timeProgress) / 4)));
-      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.feather.position.setX(11.2 * Math.min(1, easeInOut(1 - Math.max(0, 4 - game.timeProgress) / 4)));
+      game.objects.feather.position.setY(-game.courseRadius - 7.6 * Math.min(1, easeInOut(1 - Math.max(0, 4 - game.timeProgress) / 4)));
+      game.objects.feather.position.setZ(-8.9 * 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)));
       if(!game.settings['highcontrast']) {
         let letterScale = lerp(0.3, 0.0, easeInOut(Math.max(0, Math.min(1, game.timeProgress - 6))));
@@ -597,9 +612,9 @@ function animate(game, renderer, scene) {
     }
   }
 
-  if(game.timeProgress / game.timeTotal > 0.5 && game.objects.startingWindowsill.parent == scene) {
-    scene.remove(game.objects.startingWindowsill);
-    scene.add(game.objects.endingWindowsill);
+  if(game.timeProgress / game.timeTotal > 0.5 && game.objects.dayHouse.parent == scene) {
+    scene.remove(game.objects.dayHouse);
+    scene.add(game.objects.eveningHouse);
   }
 
   game.var.featherLocalPos.subVectors(game.objects.feather.position, game.view.camera.position).setZ(0);
@@ -1071,12 +1086,12 @@ function createMeshes(game) {
         let randomCameraX = game.courseRadius * Math.sin(randomAngle);
         let randomCameraY = game.courseRadius * Math.cos(randomAngle);
         let cloud = new THREE.Mesh(cloudGeometry, game.view.materials['cloud' + (i % 5 + 1) + textureVariantSuffix]);
-        cloud.position.z = -10 - Math.round(Math.random() * 40);
+        cloud.position.z = -15 - Math.round(Math.random() * 40);
         const vFOV = THREE.MathUtils.degToRad(game.view.camera.fov);
         let maxCameraDistance = 2 * Math.tan(vFOV / 2) * Math.abs(cloud.position.z - game.view.camera.position.z);
         cloud.position.x = randomCameraX + maxCameraDistance * 2 * (Math.random() - 0.5);
         cloud.position.y = randomCameraY + maxCameraDistance * 2 * (Math.random() - 0.5);
-        let scale = 20 + (Math.random() * 0.5 + 0.5) * Math.abs(cloud.position.z);
+        let scale = 21 + (Math.random() * 0.5 + 0.5) * Math.abs(cloud.position.z);
         cloud.scale.set(scale, scale, scale);
         game.objects.clouds.add(cloud);
       }
diff --git a/textures/house-day-1.png b/textures/house-day-1.png
new file mode 100644 (file)
index 0000000..1ef598d
Binary files /dev/null and b/textures/house-day-1.png differ
diff --git a/textures/house-day-2.png b/textures/house-day-2.png
new file mode 100644 (file)
index 0000000..292c00f
Binary files /dev/null and b/textures/house-day-2.png differ
diff --git a/textures/house-day-3.png b/textures/house-day-3.png
new file mode 100644 (file)
index 0000000..376fdc4
Binary files /dev/null and b/textures/house-day-3.png differ
diff --git a/textures/house-evening-1.png b/textures/house-evening-1.png
new file mode 100644 (file)
index 0000000..69cf6f9
Binary files /dev/null and b/textures/house-evening-1.png differ
diff --git a/textures/house-evening-2.png b/textures/house-evening-2.png
new file mode 100644 (file)
index 0000000..09f9ec0
Binary files /dev/null and b/textures/house-evening-2.png differ
diff --git a/textures/house-evening-3.png b/textures/house-evening-3.png
new file mode 100644 (file)
index 0000000..ea01ff4
Binary files /dev/null and b/textures/house-evening-3.png differ
diff --git a/textures/windowsill1.png b/textures/windowsill1.png
deleted file mode 100644 (file)
index 84c61fd..0000000
Binary files a/textures/windowsill1.png and /dev/null differ
diff --git a/textures/windowsill2.png b/textures/windowsill2.png
deleted file mode 100644 (file)
index ac33f8b..0000000
Binary files a/textures/windowsill2.png and /dev/null differ