cutechicken commited on
Commit
4af97d2
Β·
verified Β·
1 Parent(s): 02c0df6

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +56 -22
game.js CHANGED
@@ -1411,24 +1411,31 @@ class AIM9Missile {
1411
  this.isLoaded = true;
1412
  }
1413
 
1414
- // AIM-9 미사일 클래슀 - update λ©”μ„œλ“œ μˆ˜μ •
1415
- update(deltaTime, playerPosition) {
1416
  if (!this.mesh || !this.target || !this.target.position) {
1417
  this.destroy();
1418
  return 'expired';
1419
  }
1420
 
1421
- // *** ν”Œλ ˆμ–΄ 탐지 둜직 μΆ”κ°€ μ‹œμž‘ ***
1422
- // ν”Œλ ˆμ–΄ 탐지 및 λͺ©ν‘œ λ³€κ²½
1423
  if (window.gameInstance && !this.isTargetingFlare) {
1424
  const nearestFlare = window.gameInstance.findNearestFlare(this.position);
1425
  if (nearestFlare) {
1426
  const flareDistance = this.position.distanceTo(nearestFlare.position);
1427
- if (flareDistance < 500 && nearestFlare.heatSignature > 0.3) {
1428
- // ν”Œλ ˆμ–΄λ‘œ λͺ©ν‘œ λ³€κ²½
1429
- console.log('Missile redirected to flare!');
 
1430
  this.target = nearestFlare;
1431
  this.isTargetingFlare = true;
 
 
 
 
 
 
 
1432
  }
1433
  }
1434
  }
@@ -1757,10 +1764,23 @@ class EnemyAIM9Missile {
1757
  }
1758
 
1759
  update(deltaTime, enemyPosition) {
1760
- if (!this.mesh || !this.target || !this.target.position) {
1761
- this.destroy();
1762
- return 'expired';
 
 
 
 
 
 
 
 
 
 
 
 
1763
  }
 
1764
 
1765
  this.lifeTime -= deltaTime;
1766
  if (this.lifeTime <= 0) {
@@ -3045,19 +3065,33 @@ class Game {
3045
  }
3046
 
3047
  startGame() {
3048
- if (!this.isLoaded) {
3049
- console.log('κ²Œμž„μ΄ 아직 λ‘œλ”© μ€‘μž…λ‹ˆλ‹€...');
3050
- return;
3051
- }
3052
-
3053
- this.isStarted = true;
3054
- this.startGameTimer();
3055
-
3056
- // μ—”μ§„ μ†Œλ¦¬ μ‹œμž‘
3057
- this.fighter.startEngineSound();
3058
-
3059
- console.log('κ²Œμž„ μ‹œμž‘!');
3060
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3061
 
3062
  startBGM() {
3063
  if (this.bgmPlaying || !this.bgm) return;
 
1411
  this.isLoaded = true;
1412
  }
1413
 
1414
+ update(deltaTime, playerPosition) {
 
1415
  if (!this.mesh || !this.target || !this.target.position) {
1416
  this.destroy();
1417
  return 'expired';
1418
  }
1419
 
1420
+ // *** κ°•ν™”λœ ν”Œλ ˆμ–΄ 탐지 둜직 ***
1421
+ // ν”Œλ ˆμ–΄ 탐지 및 λͺ©ν‘œ λ³€κ²½ - 100% 성곡λ₯ 
1422
  if (window.gameInstance && !this.isTargetingFlare) {
1423
  const nearestFlare = window.gameInstance.findNearestFlare(this.position);
1424
  if (nearestFlare) {
1425
  const flareDistance = this.position.distanceTo(nearestFlare.position);
1426
+ // 탐지 거리λ₯Ό 1000m둜 ν™•λŒ€ν•˜κ³  μ—΄ μ‹ ν˜Έ 쑰건 제거
1427
+ if (flareDistance < 1000) {
1428
+ // ν”Œλ ˆμ–΄λ‘œ λͺ©ν‘œ λ³€κ²½ - 100% 성곡
1429
+ console.log('Missile redirected to flare! Distance:', flareDistance);
1430
  this.target = nearestFlare;
1431
  this.isTargetingFlare = true;
1432
+
1433
+ // ν”Œλ ˆμ–΄ 기만 성곡 μ‚¬μš΄λ“œ μž¬μƒ
1434
+ try {
1435
+ const evadeSound = new Audio('sounds/missileswing3.ogg');
1436
+ evadeSound.volume = 0.6;
1437
+ evadeSound.play().catch(e => {});
1438
+ } catch (e) {}
1439
  }
1440
  }
1441
  }
 
1764
  }
1765
 
1766
  update(deltaTime, enemyPosition) {
1767
+ if (!this.mesh || !this.target || !this.target.position) {
1768
+ this.destroy();
1769
+ return 'expired';
1770
+ }
1771
+
1772
+ // *** κ°•ν™”λœ ν”Œλ ˆμ–΄ 탐지 둜직 ***
1773
+ if (window.gameInstance && !this.isTargetingFlare) {
1774
+ const nearestFlare = window.gameInstance.findNearestFlare(this.position);
1775
+ if (nearestFlare) {
1776
+ const flareDistance = this.position.distanceTo(nearestFlare.position);
1777
+ if (flareDistance < 1000) {
1778
+ console.log('Enemy missile redirected to flare!');
1779
+ this.target = nearestFlare;
1780
+ this.isTargetingFlare = true;
1781
+ }
1782
  }
1783
+ }
1784
 
1785
  this.lifeTime -= deltaTime;
1786
  if (this.lifeTime <= 0) {
 
3065
  }
3066
 
3067
  startGame() {
3068
+ if (!this.isLoaded) {
3069
+ console.log('κ²Œμž„μ΄ 아직 λ‘œλ”© μ€‘μž…λ‹ˆλ‹€...');
3070
+ return;
 
 
 
 
 
 
 
 
 
3071
  }
3072
+
3073
+ this.isStarted = true;
3074
+ this.startGameTimer();
3075
+
3076
+ // μ—”μ§„ μ†Œλ¦¬ μ‹œμž‘
3077
+ this.fighter.startEngineSound();
3078
+
3079
+ // κ²Œμž„ μ‹œμž‘ μŒμ„± μž¬μƒ
3080
+ try {
3081
+ const startVoice = new Audio('sounds/voice_start_a.ogg');
3082
+ startVoice.volume = 0.8;
3083
+ startVoice.play().catch(e => {
3084
+ console.log('Start voice failed to play:', e);
3085
+ });
3086
+ } catch (e) {
3087
+ console.log('Start voice error:', e);
3088
+ }
3089
+
3090
+ // μžλ§‰ ν‘œμ‹œ
3091
+ this.showSubtitle('Listen up! Find and shut down all enemy squad that invaded their airspace.', 5000);
3092
+
3093
+ console.log('κ²Œμž„ μ‹œμž‘!');
3094
+ }
3095
 
3096
  startBGM() {
3097
  if (this.bgmPlaying || !this.bgm) return;