cutechicken commited on
Commit
396aff0
Β·
verified Β·
1 Parent(s): d1910ab

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +84 -2
index.html CHANGED
@@ -496,9 +496,36 @@
496
  <!-- 탄약 ν‘œμ‹œ -->
497
  <div id="ammoDisplay">AMMO: 300</div>
498
 
499
- <!-- λ ˆμ΄λ” -->
500
  <div id="radar">
501
- <div id="radarLine"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
502
  </div>
503
  </div>
504
 
@@ -583,10 +610,65 @@
583
  const rollDegrees = fighter.rotation.z * (180 / Math.PI);
584
  hudCrosshair.style.transform = `translate(-50%, -50%) rotate(${-rollDegrees}deg)`;
585
  }
 
 
586
  }
587
  }, 16); // μ•½ 60fps
588
  });
589
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
590
  // startGame ν•¨μˆ˜ μ •μ˜
591
  window.startGame = function() {
592
  if (!window.gameInstance || !window.gameInstance.isLoaded || !window.gameInstance.isBGMReady) {
 
496
  <!-- 탄약 ν‘œμ‹œ -->
497
  <div id="ammoDisplay">AMMO: 300</div>
498
 
499
+ <!-- λ ˆμ΄λ” (RWR) -->
500
  <div id="radar">
501
+ <div class="rwr-display">
502
+ <!-- RWR 거리 링 -->
503
+ <div class="rwr-range-ring rwr-ring-inner"></div>
504
+ <div class="rwr-range-ring rwr-ring-middle"></div>
505
+ <div class="rwr-range-ring rwr-ring-outer"></div>
506
+
507
+ <!-- λ°©ν–₯ ν‘œμ‹œ -->
508
+ <div class="rwr-direction-marks">
509
+ <div class="rwr-direction-text rwr-north">N</div>
510
+ <div class="rwr-direction-text rwr-east">E</div>
511
+ <div class="rwr-direction-text rwr-south">S</div>
512
+ <div class="rwr-direction-text rwr-west">W</div>
513
+ </div>
514
+
515
+ <!-- 쀑앙 항곡기 심볼 -->
516
+ <div class="rwr-center">
517
+ <div class="rwr-aircraft-symbol">
518
+ <div class="rwr-aircraft-body"></div>
519
+ <div class="rwr-aircraft-wing"></div>
520
+ </div>
521
+ </div>
522
+
523
+ <!-- μœ„ν˜‘ ν‘œμ‹œ μ˜μ—­ -->
524
+ <div id="rwrThreats"></div>
525
+ </div>
526
+
527
+ <!-- κΈ°μ‘΄ λ ˆμ΄λ” μš”μ†Œ (μˆ¨κΉ€) -->
528
+ <div id="radarLine" style="display: none;"></div>
529
  </div>
530
  </div>
531
 
 
610
  const rollDegrees = fighter.rotation.z * (180 / Math.PI);
611
  hudCrosshair.style.transform = `translate(-50%, -50%) rotate(${-rollDegrees}deg)`;
612
  }
613
+ // RWR μ—…λ°μ΄νŠΈ
614
+ updateRWR(fighter);
615
  }
616
  }, 16); // μ•½ 60fps
617
  });
618
 
619
+ // RWR μ—…λ°μ΄νŠΈ ν•¨μˆ˜
620
+ function updateRWR(fighter) {
621
+ const rwrThreats = document.getElementById('rwrThreats');
622
+ if (!rwrThreats || !window.gameInstance) return;
623
+
624
+ // κΈ°μ‘΄ μœ„ν˜‘ ν‘œμ‹œ 제거
625
+ rwrThreats.innerHTML = '';
626
+
627
+ // 적 항곡기 ν‘œμ‹œ
628
+ if (window.gameInstance.enemies) {
629
+ window.gameInstance.enemies.forEach((enemy, index) => {
630
+ if (!enemy.mesh || !enemy.isLoaded) return;
631
+
632
+ const distance = fighter.position.distanceTo(enemy.position);
633
+
634
+ // 10km μ΄λ‚΄μ˜ 적만 RWR에 ν‘œμ‹œ
635
+ if (distance <= 10000) {
636
+ // μƒλŒ€ μœ„μΉ˜ 계산
637
+ const relativePos = enemy.position.clone().sub(fighter.position);
638
+
639
+ // μ „νˆ¬κΈ°μ˜ heading을 κ³ λ €ν•œ 각도 계산
640
+ const angle = Math.atan2(relativePos.x, relativePos.z) - fighter.rotation.y;
641
+
642
+ // RWR μƒμ˜ μœ„μΉ˜ 계산 (μ΅œλŒ€ 반경 90px)
643
+ const maxRadius = 90;
644
+ const relativeDistance = Math.min(distance / 10000, 1) * maxRadius;
645
+
646
+ const x = Math.sin(angle) * relativeDistance + 100; // 쀑앙이 100px
647
+ const y = -Math.cos(angle) * relativeDistance + 100;
648
+
649
+ // μœ„ν˜‘ 심볼 생성
650
+ const threat = document.createElement('div');
651
+ threat.className = 'rwr-threat';
652
+
653
+ // 거리에 λ”°λ₯Έ μœ„ν˜‘ 레벨
654
+ if (distance < 2000) {
655
+ threat.classList.add('missile-lock');
656
+ threat.textContent = '!';
657
+ } else if (distance < 5000) {
658
+ threat.textContent = 'β—†';
659
+ } else {
660
+ threat.textContent = 'β–²';
661
+ }
662
+
663
+ threat.style.left = `${x}px`;
664
+ threat.style.top = `${y}px`;
665
+
666
+ rwrThreats.appendChild(threat);
667
+ }
668
+ });
669
+ }
670
+ }
671
+
672
  // startGame ν•¨μˆ˜ μ •μ˜
673
  window.startGame = function() {
674
  if (!window.gameInstance || !window.gameInstance.isLoaded || !window.gameInstance.isBGMReady) {