add main theme

This commit is contained in:
Mylloon 2022-12-03 22:54:48 +01:00
parent a67e3ffd25
commit cb448f07f6
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
4 changed files with 15 additions and 0 deletions

4
.gitignore vendored
View file

@ -1,7 +1,11 @@
js/lib/* js/lib/*
assets/images/* assets/images/*
!assets/images/*.md !assets/images/*.md
assets/music/*
!assets/music/*.md
report/* report/*
!report/*.tex !report/*.tex

3
assets/music/SOURCES.md Normal file
View file

@ -0,0 +1,3 @@
| Music | URL |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| theme.wav | https://www.beepbox.co/#9n31s0k0l00e02t2ma7g0fj07r1i0o432T1v1u16f0q00d03A0F0B0Q0000Pff00E1617T1v6u60f0q0x10h51d19AbF8B7Q0471Peb9aE2b676T1v7ue1f0q0y10n73d4aA0F0B7Q0000Pe600E2bb619T3v4uf7f0qwx10m711d08SZIztrsrzrqiiiiiE1b6b4z000000000h400000000000000000004h000000000p22mFH_gGqfi5Oo7bOldjRV1jnUaqfHA4OZ5dl50KhAQk2VmjhgbBYFhhhBpt556jlBQkkpB0aqfo1HQk5d1jhgnQ0bdvWAjbMbibihQV4V17jihQV4V17jjq_2C-6V1fW3N8aqcgnSTkSlSlSkSlSlS00 |

View file

@ -43,6 +43,10 @@ export class Env {
// Clock // Clock
this.clock = new THREE.Clock(); this.clock = new THREE.Clock();
// Music player
this.music = new Audio("./assets/music/theme.wav");
this.music.loop = true;
} }
/** /**
@ -124,6 +128,7 @@ export class Env {
) { ) {
// If animation returned false, the player died! // If animation returned false, the player died!
playerDead = true; playerDead = true;
this.music.pause();
} }
} }
}); });

View file

@ -109,6 +109,9 @@ export const runGame = (demo) => {
requestAnimationFrame(animate); requestAnimationFrame(animate);
}; };
// Start music
env.music.play();
// Run it // Run it
animate(); animate();
}; };