Spaces:
Running
Running
cutechicken
commited on
Commit
β’
f8f064d
1
Parent(s):
c911e86
Update game.js
Browse files
game.js
CHANGED
@@ -922,13 +922,19 @@ class Game {
|
|
922 |
|
923 |
async initialize() {
|
924 |
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
925 |
// μμ μ¬μ΄λ μ¬μ
|
926 |
const startSounds = ['sounds/start1.ogg', 'sounds/start2.ogg', 'sounds/start3.ogg'];
|
927 |
const randomStartSound = startSounds[Math.floor(Math.random() * startSounds.length)];
|
928 |
const startAudio = new Audio(randomStartSound);
|
929 |
startAudio.volume = 0.5;
|
930 |
startAudio.play();
|
931 |
-
|
932 |
// λ λλ¬ μ€μ
|
933 |
this.renderer.shadowMap.enabled = true;
|
934 |
this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
|
|
922 |
|
923 |
async initialize() {
|
924 |
try {
|
925 |
+
// BGM μ¬μ μ½λ μΆκ°
|
926 |
+
this.bgm = new Audio('sounds/BGM.ogg');
|
927 |
+
this.bgm.volume = 0.5;
|
928 |
+
this.bgm.loop = true; // BGM λ°λ³΅ μ¬μ
|
929 |
+
this.bgm.play();
|
930 |
+
|
931 |
// μμ μ¬μ΄λ μ¬μ
|
932 |
const startSounds = ['sounds/start1.ogg', 'sounds/start2.ogg', 'sounds/start3.ogg'];
|
933 |
const randomStartSound = startSounds[Math.floor(Math.random() * startSounds.length)];
|
934 |
const startAudio = new Audio(randomStartSound);
|
935 |
startAudio.volume = 0.5;
|
936 |
startAudio.play();
|
937 |
+
|
938 |
// λ λλ¬ μ€μ
|
939 |
this.renderer.shadowMap.enabled = true;
|
940 |
this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|