if(game.settings['graphics'] == 3) {
cameraSwayFactor = 0;
}
- let cameraX = -5;
- let cameraY = 0;
+ let cameraX, cameraY;
if(game.ui.currentPage == 'title') {
+ cameraX = -5;
+ cameraY = 0;
if(!game.ui.reachedEnd) {
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 if(game.ui.currentPage == 'openingcutscene') {
+ cameraX = -5;
+ cameraY = 0;
if(game.ui.reachedEnd) {
game['fn'].reset();
}
game['fn'].moveToPage('gameplay', true);
}
} else if(game.ui.currentPage == 'endingcutscene') {
+ cameraX = -5;
+ cameraY = 0;
cameraSwayFactor = cameraSwayFactor * game.timeProgress / 8;
cameraX = 5 - Math.pow(Math.max(0, 5 - game.timeProgress) / 5, 1.6) * 5;
let trajectoryLerpValue = game['fn'].easeInOut(Math.min(6.0, game.timeProgress) / 6);
}
} else if(game.ui.reachedEnd) {
cameraX = 5;
+ cameraY = 0;
+ }
+ if(typeof(cameraX) == 'number' && typeof(cameraY) == 'number') {
+ game.view.camera.position.setY(cameraY - game.courseRadius + 0.07 * cameraSwayFactor * Math.sin(game.view.clock.getElapsedTime() * 0.5));
+ game.view.camera.position.setX(cameraX + 0.05 * cameraSwayFactor * Math.sin(game.view.clock.getElapsedTime() * 0.7));
}
- game.view.camera.position.setY(cameraY - game.courseRadius + 0.07 * cameraSwayFactor * Math.sin(game.view.clock.getElapsedTime() * 0.5));
- game.view.camera.position.setX(cameraX + 0.05 * cameraSwayFactor * Math.sin(game.view.clock.getElapsedTime() * 0.7));
game.view.renderer.render(scene, game.view.camera);
return;
}
};
// Set up name mirrors for each function that should survive most minifiers and transpilers
-game['fn']['animate'] = game['fn'].animate;
-game['fn']['applyForceToFeather'] = game['fn'].applyForceToFeather;
-game['fn']['applySettings'] = game['fn'].applySettings;
-game['fn']['createFeather'] = game['fn'].createFeather;
-game['fn']['createMeshes'] = game['fn'].createMeshes;
-game['fn']['easeInOut'] = game['fn'].easeInOut;
-game['fn']['initializeGame'] = game['fn'].initializeGame;
-game['fn']['lerp'] = game['fn'].lerp;
-game['fn']['loadAllAssets'] = game['fn'].loadAllAssets;
-game['fn']['loadSettings'] = game['fn'].loadSettings;
-game['fn']['moveToPage'] = game['fn'].moveToPage;
-game['fn']['playRandomSound'] = game['fn'].playRandomSound;
-game['fn']['prepareWordMesh'] = game['fn'].prepareWordMesh;
-game['fn']['reset'] = game['fn'].reset;
-game['fn']['start'] = game['fn'].start;
-game['fn']['unlockFeather'] = game['fn'].unlockFeather;
-game['fn']['unlockWithKey'] = game['fn'].unlockWithKey;
+game['fn'].animate['friendlyName'] = 'animate';
+game['fn'].applyForceToFeather['friendlyName'] = 'applyForceToFeather';
+game['fn'].applySettings['friendlyName'] = 'applySettings';
+game['fn'].createFeather['friendlyName'] = 'createFeather';
+game['fn'].createMeshes['friendlyName'] = 'createMeshes';
+game['fn'].easeInOut['friendlyName'] = 'easeInOut';
+game['fn'].initializeGame['friendlyName'] = 'initializeGame';
+game['fn'].lerp['friendlyName'] = 'lerp';
+game['fn'].loadAllAssets['friendlyName'] = 'loadAllAssets';
+game['fn'].loadSettings['friendlyName'] = 'loadSettings';
+game['fn'].moveToPage['friendlyName'] = 'moveToPage';
+game['fn'].playRandomSound['friendlyName'] = 'playRandomSound';
+game['fn'].prepareWordMesh['friendlyName'] = 'prepareWordMesh';
+game['fn'].reset['friendlyName'] = 'reset';
+game['fn'].start['friendlyName'] = 'start';
+game['fn'].unlockFeather['friendlyName'] = 'unlockFeather';
+game['fn'].unlockWithKey['friendlyName'] = 'unlockWithKey';
game['fn'].start();