Spaces:
Running
Running
Update index.html
Browse files- 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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) {
|