Spaces:
Running
Running
Update game.js
Browse files
game.js
CHANGED
@@ -792,9 +792,9 @@ class Fighter {
|
|
792 |
|
793 |
// ๋ฐ์ฌ ์ฌ์ด๋
|
794 |
try {
|
795 |
-
const audio = new Audio('sounds/
|
796 |
audio.volume = 0.6;
|
797 |
-
audio.play().catch(e => console.log('Missile launch sound
|
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();
|