sad piano on exit
This commit is contained in:
parent
70dd803ab0
commit
39b4e939bf
BIN
ambiance.mp3
BIN
ambiance.mp3
Binary file not shown.
6
main.js
6
main.js
@ -70,8 +70,9 @@ const mazeWidth = 51
|
|||||||
let showGUI = window.location.search.includes("debug")
|
let showGUI = window.location.search.includes("debug")
|
||||||
let showStats = window.location.search.includes("stats")
|
let showStats = window.location.search.includes("stats")
|
||||||
|
|
||||||
const ambiance = new Audio("ambiance.mp3")
|
const ambiance = new Audio("snd/ambiance.mp3")
|
||||||
ambiance.loop = true
|
ambiance.loop = true
|
||||||
|
const piano = new Audio("snd/waves-and-tears.mp3")
|
||||||
|
|
||||||
const loadMngr = new THREE.LoadingManager();
|
const loadMngr = new THREE.LoadingManager();
|
||||||
const loader = new THREE.TextureLoader(loadMngr);
|
const loader = new THREE.TextureLoader(loadMngr);
|
||||||
@ -287,7 +288,7 @@ function updateSun() {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
const time = clock.elapsedTime ;
|
const time = clock.elapsedTime ;
|
||||||
const hour = ( 8 + time / 1440 ) % 24
|
const hour = ( 14 + time / 1440 ) % 24
|
||||||
const hourAngle = Math.PI * (1-hour/12)
|
const hourAngle = Math.PI * (1-hour/12)
|
||||||
elevation = Math.asin( Math.sin(declination)*Math.sin(latitude) + Math.cos(declination)*Math.cos(latitude)*Math.cos(hourAngle) )
|
elevation = Math.asin( Math.sin(declination)*Math.sin(latitude) + Math.cos(declination)*Math.cos(latitude)*Math.cos(hourAngle) )
|
||||||
azimuth = 0.6 + Math.asin( Math.cos(declination)*Math.sin(hourAngle)/Math.cos(elevation) )
|
azimuth = 0.6 + Math.asin( Math.cos(declination)*Math.sin(hourAngle)/Math.cos(elevation) )
|
||||||
@ -454,6 +455,7 @@ function playerCollisions() {
|
|||||||
if ( !stopAnimation && raftOctree.capsuleIntersect( playerCollider ) ) {
|
if ( !stopAnimation && raftOctree.capsuleIntersect( playerCollider ) ) {
|
||||||
|
|
||||||
message.className = "escaped";
|
message.className = "escaped";
|
||||||
|
piano.play();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
snd/ambiance.mp3
Normal file
BIN
snd/ambiance.mp3
Normal file
Binary file not shown.
BIN
snd/waves-and-tears.mp3
Normal file
BIN
snd/waves-and-tears.mp3
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user