Update index.html
Browse files- index.html +84 -0
index.html
CHANGED
|
@@ -511,6 +511,90 @@
|
|
| 511 |
}
|
| 512 |
</script>
|
| 513 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 514 |
<script src="game.js" type="module"></script>
|
| 515 |
</body>
|
| 516 |
</html>
|
|
|
|
| 511 |
}
|
| 512 |
</script>
|
| 513 |
|
| 514 |
+
<!-- νΌμΉ λλ λ° HUD μ
λ°μ΄νΈ μ€ν¬λ¦½νΈ -->
|
| 515 |
+
<script>
|
| 516 |
+
// μ μ λ³μ
|
| 517 |
+
let gameStarted = false;
|
| 518 |
+
|
| 519 |
+
// κ²μ μ€λΉ μλ£ μ HUD μ
λ°μ΄νΈ μμ
|
| 520 |
+
window.addEventListener('gameReady', function() {
|
| 521 |
+
// μ€μ HUD μ 보 μ
λ°μ΄νΈλ₯Ό μν μΈν°λ²
|
| 522 |
+
setInterval(function() {
|
| 523 |
+
if (window.gameInstance && window.gameInstance.fighter && window.gameInstance.fighter.isLoaded) {
|
| 524 |
+
const fighter = window.gameInstance.fighter;
|
| 525 |
+
|
| 526 |
+
// λΉν μ 보 κ³μ°
|
| 527 |
+
const speedKnots = Math.round(fighter.speed * 1.94384);
|
| 528 |
+
const altitudeMeters = Math.round(fighter.altitude);
|
| 529 |
+
const throttlePercent = Math.round(fighter.throttle * 100);
|
| 530 |
+
const gForce = fighter.gForce.toFixed(1);
|
| 531 |
+
const headingDegrees = Math.round(((fighter.rotation.y * (180 / Math.PI)) + 360) % 360);
|
| 532 |
+
|
| 533 |
+
// μ€μ HUD μ 보 μ
λ°μ΄νΈ
|
| 534 |
+
const hudSpeedCentral = document.getElementById('hudSpeedCentral');
|
| 535 |
+
const hudAltitudeCentral = document.getElementById('hudAltitudeCentral');
|
| 536 |
+
const hudHeadingCentral = document.getElementById('hudHeadingCentral');
|
| 537 |
+
const hudGForceCentral = document.getElementById('hudGForceCentral');
|
| 538 |
+
const hudThrottleCentral = document.getElementById('hudThrottleCentral');
|
| 539 |
+
|
| 540 |
+
if (hudSpeedCentral) hudSpeedCentral.textContent = `SPD: ${speedKnots} KT`;
|
| 541 |
+
if (hudAltitudeCentral) hudAltitudeCentral.textContent = `ALT: ${altitudeMeters} M`;
|
| 542 |
+
if (hudHeadingCentral) hudHeadingCentral.textContent = `HDG: ${String(headingDegrees).padStart(3, '0')}Β°`;
|
| 543 |
+
if (hudGForceCentral) {
|
| 544 |
+
hudGForceCentral.textContent = `G: ${gForce}`;
|
| 545 |
+
// G-Forceμ λ°λ₯Έ μμ λ³κ²½
|
| 546 |
+
if (fighter.overG) {
|
| 547 |
+
hudGForceCentral.style.color = '#ff0000';
|
| 548 |
+
} else if (parseFloat(gForce) > 7) {
|
| 549 |
+
hudGForceCentral.style.color = '#ffff00';
|
| 550 |
+
} else {
|
| 551 |
+
hudGForceCentral.style.color = '#00ff00';
|
| 552 |
+
}
|
| 553 |
+
}
|
| 554 |
+
if (hudThrottleCentral) hudThrottleCentral.textContent = `THR: ${throttlePercent}%`;
|
| 555 |
+
|
| 556 |
+
// νΌμΉ λλ μ
λ°μ΄νΈ - μ ν¬κΈ°κ° μνμΌ λ 0λκ° μ€μμ μ€λλ‘
|
| 557 |
+
const pitchLadder = document.getElementById('pitchLadder');
|
| 558 |
+
if (pitchLadder) {
|
| 559 |
+
const pitchDegrees = fighter.rotation.x * (180 / Math.PI);
|
| 560 |
+
// 10λλΉ 20ν½μ
, μμλ‘ λ°λ λ°©ν₯
|
| 561 |
+
const pitchOffset = -pitchDegrees * 2;
|
| 562 |
+
pitchLadder.style.transform = `translateY(${pitchOffset}px)`;
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
// HUD ν¬λ‘μ€ν€μ΄ νμ (λ‘€ κ°λμ λ°λΌ)
|
| 566 |
+
const hudCrosshair = document.getElementById('hudCrosshair');
|
| 567 |
+
if (hudCrosshair && fighter.rotation) {
|
| 568 |
+
const rollDegrees = fighter.rotation.z * (180 / Math.PI);
|
| 569 |
+
hudCrosshair.style.transform = `translate(-50%, -50%) rotate(${-rollDegrees}deg)`;
|
| 570 |
+
}
|
| 571 |
+
}
|
| 572 |
+
}, 16); // μ½ 60fps
|
| 573 |
+
});
|
| 574 |
+
|
| 575 |
+
// startGame ν¨μ μ μ
|
| 576 |
+
window.startGame = function() {
|
| 577 |
+
if (!window.gameInstance || !window.gameInstance.isLoaded || !window.gameInstance.isBGMReady) {
|
| 578 |
+
console.log('κ²μμ΄ μμ§ μ€λΉλμ§ μμμ΅λλ€...');
|
| 579 |
+
return;
|
| 580 |
+
}
|
| 581 |
+
|
| 582 |
+
gameStarted = true;
|
| 583 |
+
document.getElementById('startScreen').style.display = 'none';
|
| 584 |
+
|
| 585 |
+
// κ²μ νμ΄ν μ¨κΈ°κΈ°
|
| 586 |
+
const gameTitle = document.getElementById('gameTitle');
|
| 587 |
+
if (gameTitle) {
|
| 588 |
+
gameTitle.style.display = 'none';
|
| 589 |
+
}
|
| 590 |
+
|
| 591 |
+
document.body.requestPointerLock();
|
| 592 |
+
|
| 593 |
+
window.gameInstance.startBGM();
|
| 594 |
+
window.gameInstance.startGame();
|
| 595 |
+
}
|
| 596 |
+
</script>
|
| 597 |
+
|
| 598 |
<script src="game.js" type="module"></script>
|
| 599 |
</body>
|
| 600 |
</html>
|