cutechicken commited on
Commit
c0e7039
ยท
verified ยท
1 Parent(s): f7c8023

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +14 -12
game.js CHANGED
@@ -792,9 +792,9 @@ class Fighter {
792
 
793
  // ๋ฐœ์‚ฌ ์‚ฌ์šด๋“œ
794
  try {
795
- const audio = new Audio('sounds/towfirelaunch.ogg');
796
  audio.volume = 0.6;
797
- audio.play().catch(e => console.log('Missile launch sound failed to play'));
798
  } catch (e) {
799
  console.log('Audio error:', e);
800
  }
@@ -856,11 +856,11 @@ class Fighter {
856
  this.missileLockTimer = 0;
857
  this.missileLockCount++;
858
 
859
- // ๋ฝ์˜จ ์‚ฌ์šด๋“œ
860
  try {
861
- const lockSound = new Audio('sounds/lock.ogg');
862
- lockSound.volume = 0.3;
863
- lockSound.play().catch(e => {});
864
  } catch (e) {}
865
 
866
  if (this.missileLockCount >= 3) {
@@ -1610,11 +1610,11 @@ class Game {
1610
  this.fighter.missileLockCount = 0;
1611
  this.fighter.missileLockTimer = 0;
1612
 
1613
- // ๋ฌด๊ธฐ ๋ณ€๊ฒฝ ์‚ฌ์šด๋“œ
1614
  try {
1615
- const switchSound = new Audio('sounds/switch.ogg');
1616
- switchSound.volume = 0.3;
1617
- switchSound.play().catch(e => {});
1618
  } catch (e) {}
1619
  }
1620
 
@@ -2305,7 +2305,7 @@ class Game {
2305
  try {
2306
  const explosionSound = new Audio('sounds/explosion.ogg');
2307
  explosionSound.volume = 0.6;
2308
- explosionSound.play().catch(e => {});
2309
  } catch (e) {}
2310
  }
2311
 
@@ -2399,7 +2399,7 @@ class Game {
2399
  try {
2400
  const hitSound = new Audio('sounds/hit.ogg');
2401
  hitSound.volume = 0.3;
2402
- hitSound.play().catch(e => {});
2403
  } catch (e) {}
2404
  }
2405
 
@@ -2470,6 +2470,8 @@ class Game {
2470
  this.fighter.updatePhysics(deltaTime);
2471
  this.fighter.updateBullets(this.scene, deltaTime);
2472
 
 
 
2473
  // ๋งˆ์šฐ์Šค ๋ˆ„๋ฆ„ ์ƒํƒœ์ผ ๋•Œ ์—ฐ์† ๋ฐœ์‚ฌ
2474
  if (this.fighter.isMouseDown && this.isStarted && this.fighter.currentWeapon === 'mg') {
2475
  const currentShootTime = Date.now();
 
792
 
793
  // ๋ฐœ์‚ฌ ์‚ฌ์šด๋“œ
794
  try {
795
+ const audio = new Audio('sounds/Towfirelaunch.ogg');
796
  audio.volume = 0.6;
797
+ audio.play().catch(e => console.log('Missile launch sound not found'));
798
  } catch (e) {
799
  console.log('Audio error:', e);
800
  }
 
856
  this.missileLockTimer = 0;
857
  this.missileLockCount++;
858
 
859
+ // ๋ฝ์˜จ ์‚ฌ์šด๋“œ (lock.ogg๊ฐ€ ์—†์œผ๋ฉด ๋ฌด์‹œ)
860
  try {
861
+ // const lockSound = new Audio('sounds/lock.ogg');
862
+ // lockSound.volume = 0.3;
863
+ // lockSound.play().catch(e => {});
864
  } catch (e) {}
865
 
866
  if (this.missileLockCount >= 3) {
 
1610
  this.fighter.missileLockCount = 0;
1611
  this.fighter.missileLockTimer = 0;
1612
 
1613
+ // ๋ฌด๊ธฐ ๋ณ€๊ฒฝ ์‚ฌ์šด๋“œ (switch.ogg๊ฐ€ ์—†์œผ๋ฉด ๋ฌด์‹œ)
1614
  try {
1615
+ // const switchSound = new Audio('sounds/switch.ogg');
1616
+ // switchSound.volume = 0.3;
1617
+ // switchSound.play().catch(e => {});
1618
  } catch (e) {}
1619
  }
1620
 
 
2305
  try {
2306
  const explosionSound = new Audio('sounds/explosion.ogg');
2307
  explosionSound.volume = 0.6;
2308
+ explosionSound.play().catch(e => console.log('Explosion sound not found'));
2309
  } catch (e) {}
2310
  }
2311
 
 
2399
  try {
2400
  const hitSound = new Audio('sounds/hit.ogg');
2401
  hitSound.volume = 0.3;
2402
+ hitSound.play().catch(e => console.log('Hit sound not found'));
2403
  } catch (e) {}
2404
  }
2405
 
 
2470
  this.fighter.updatePhysics(deltaTime);
2471
  this.fighter.updateBullets(this.scene, deltaTime);
2472
 
2473
+ // ์ค‘๋ณต๋œ ๋ฏธ์‚ฌ์ผ ๋ฝ์˜จ ์—…๋ฐ์ดํŠธ ๋ผ์ธ ์ œ๊ฑฐ (์ด๋ฏธ ์œ„์— ์žˆ์Œ)
2474
+
2475
  // ๋งˆ์šฐ์Šค ๋ˆ„๋ฆ„ ์ƒํƒœ์ผ ๋•Œ ์—ฐ์† ๋ฐœ์‚ฌ
2476
  if (this.fighter.isMouseDown && this.isStarted && this.fighter.currentWeapon === 'mg') {
2477
  const currentShootTime = Date.now();