'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)) {
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;
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(() => {
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;
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;
} 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))));
}
}
- 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);
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);
}