-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
68 lines (58 loc) · 1.72 KB
/
script.js
File metadata and controls
68 lines (58 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const scene = document.querySelector('a-scene');
const loading = document.getElementById('loading');
const marsbg = document.getElementById('marsbg');
const startbtn = document.getElementById('startbtn');
let introplaying = true;
function showbtn() {
startbtn.innerHTML = "ENTER";
startbtn.style.display = "block";
startbtn.style.pointerEvents = "all";
startbtn.style.color = "#ffffff";
}
function playintro() {
const sndintro = document.getElementById("intro").components.sound;
sndintro.playSound();
}
function introended() {
introplaying = false;
}
function startexp() {
loading.classList.toggle('hide');
marsbg.classList.toggle('hide');
loading.style.pointerEvents = "none";
startbtn.style.pointerEvents = "none";
const selection = document.getElementById("selection").components.sound;
selection.playSound();
const ambient = document.getElementById("ambient").components.sound;
ambient.playSound();
setTimeout(playintro, 2500);
setTimeout(introended, 50500);
}
if (scene.hasLoaded) {
showbtn();
} else {
scene.addEventListener('loaded', showbtn);
}
function goscreen2(){
const screen1 = document.getElementById("screen1");
const screen2 = document.getElementById("screen2");
screen1.style.display = "none";
screen2.style.display = "block";
}
const stickleft = document.getElementById("stickleft");
const stickright = document.getElementById("stickright");
const thecamera = document.getElementById("droneobject");
let newrotation;
let camerarotation;
let currentrotation;
let rotationcount = 0;
let turning = 2;
let currentspeed = .2;
const el = this.el,
data = this.data;
let elevationspeed = .1;
let cameraposition;
let newposition;
let currentposition;
let elevation = 0;
let resetdrone = true;