'textures/feather-black.png': 1026,
'textures/feather-blue.png': 1026,
'textures/feather-brown.png': 1027,
- 'textures/feather-ghost.png': 1023,
- 'textures/feather-golden.png': 1027,
'textures/feather-green.png': 1028,
'textures/feather-orange.png': 1028,
'textures/feather-purple.png': 1028,
'textures/windowsill1.png': 483119,
'textures/windowsill2.png': 484665,
};
+ for(let unlockable of ['golden', 'ghost']) {
+ if(game.settings['unlocks'].includes(unlockable)) {
+ if(unlockable == 'golden') {
+ todoList['textures/feather-' + unlockable + '.png'] = 1027;
+ } else {
+ todoList['textures/feather-' + unlockable + '.png'] = 1023;
+ }
+ }
+ }
let total = Object.keys(todoList).map(k => todoList[k]).reduce((a, b) => a + b, 0);
let progress = {};
const loader = {
if(segments[0] == 'textures') {
result.colorSpace = THREE.SRGBColorSpace;
result.magFilter = THREE.NearestFilter;
- if(segments[1].split('.')[0] == 'highcontrast-backdrop') {
+ if(segments[1].split('.')[0].startsWith('feather-')) {
+ result.repeat = new THREE.Vector2(1, -1);
+ result.wrapT = THREE.RepeatWrapping;
+ } else if(segments[1].split('.')[0] == 'highcontrast-backdrop') {
result.repeat = new THREE.Vector2(25, 25);
result.wrapS = THREE.RepeatWrapping;
result.wrapT = THREE.RepeatWrapping;
return deltaTime;
};
- const featherGeometry = new THREE.PlaneGeometry(1.6, 0.5);
- const featherMaterial = new THREE.MeshPhongMaterial({
- map: game.assets.textures.feather,
- transparent: true,
- alphaTest: 0.5,
- side: THREE.DoubleSide,
- });
- game.objects.feather = new THREE.Mesh(featherGeometry, featherMaterial);
- game.objects.feather.rotation.order = 'ZXY';
- game.objects.feather.position.set(0, -game.courseRadius, 0);
- scene.add(game.objects.feather);
- game.objects.feather.speed = new THREE.Vector3(0, 0, 0);
- game.gravity = new THREE.Vector3(0, -0.1, 0);
- game.objects.feather.swayDirection = 0.2;
- game.objects.feather.twistSpeed = 0.1;
-
const pinwheelGeometry = new THREE.BoxGeometry(.9, .9, 0.01);
const pinwheelMaterial = new THREE.MeshPhongMaterial({
map: game.assets.textures.pinwheel,
game.view.scene = scene;
createMeshes(game);
+ createFeather(game);
reset(game);
function pinwheelPositionUpdate(game, viewportX, viewportY) {
}
}
+function createFeather(game) {
+ let position, rotation;
+ if(game.objects.feather) {
+ position = game.objects.feather.position;
+ rotation = game.objects.feather.rotation;
+ game.objects.feather.geometry.dispose();
+ game.objects.feather.material.dispose();
+ game.view.scene.remove(game.objects.feather);
+ delete game.objects.feather;
+ }
+
+ const featherGeometry = new THREE.PlaneGeometry(1.6, 0.5);
+ game.view.materials.feather = new THREE.MeshPhongMaterial({
+ map: game.assets.textures['feather-' + game.settings['feather']],
+ transparent: true,
+ alphaTest: 0.5,
+ side: THREE.DoubleSide,
+ });
+ game.objects.feather = new THREE.Mesh(featherGeometry, game.view.materials.feather);
+ game.objects.feather.rotation.order = 'ZXY';
+ if(position) {
+ game.objects.feather.position.set(position.x, position.y, position.z);
+ }
+ if(rotation) {
+ game.objects.feather.rotation.set(rotation.x, rotation.y, rotation.z);
+ }
+ game.view.scene.add(game.objects.feather);
+ game.objects.feather.speed = new THREE.Vector3(0, 0, 0);
+ game.gravity = new THREE.Vector3(0, -0.1, 0);
+ game.objects.feather.swayDirection = 0.2;
+ game.objects.feather.twistSpeed = 0.1;
+}
+
function createMeshes(game) {
if(game.objects.clouds && game.objects.clouds.parent == game.view.scene) {
game.view.scene.remove(game.objects.clouds);
delete game.view.materials;
}
- game.view.materials = {};
+ if(game.view.materials && game.view.materials.feather) {
+ game.view.materials = {
+ 'feather': game.view.materials['feather'],
+ };
+ } else {
+ game.view.materials = {};
+ }
+
if(!game.settings['highcontrast']) {
let cloudShaders;
let cloudGeometry = new THREE.PlaneGeometry(1, 200 / 350);
if(elem.name == 'upInTheAirGame-controls') {
game.ui.root.querySelectorAll('.options .controls p span:not(.' + game.settings['controls'] + ')').forEach(span => span.style.display = 'none');
game.ui.root.querySelector('.options .controls span.' + game.settings['controls']).style.display = 'block';
- }
- if(elem.value == 'highcontrast' || elem.name == 'upInTheAirGame-graphics') {
+ } else if(elem.value == 'highcontrast' || elem.name == 'upInTheAirGame-graphics') {
createMeshes(game);
+ } else if(elem.name == 'upInTheAirGame-feather') {
+ createFeather(game);
}
});
});