cutechicken commited on
Commit
f8f064d
β€’
1 Parent(s): c911e86

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +7 -1
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;