Spaces:
Running
Running
Update game.js
Browse files
game.js
CHANGED
@@ -311,18 +311,27 @@ class Fighter {
|
|
311 |
const turnRate = Math.abs(bankTurnRate) * 100;
|
312 |
const pitchRate = Math.abs(this.rotation.x - this.targetPitch) * 10;
|
313 |
|
|
|
|
|
|
|
|
|
314 |
// ๋น์ ์์ ์ธ ์์ธ์ ์ํ G-Force ์ถ๊ฐ
|
315 |
let abnormalG = 0;
|
316 |
|
317 |
// ๋ค์งํ ์ํ (๋กค์ด 90๋ ์ด์)
|
318 |
const isInverted = Math.abs(this.rotation.z) > Math.PI / 2;
|
319 |
if (isInverted) {
|
320 |
-
abnormalG += 3.0 + Math.abs(Math.abs(this.rotation.z) - Math.PI / 2) * 2; //
|
321 |
}
|
322 |
|
323 |
// ๊ธฐ์๊ฐ ๊ณ์ ์๋ฅผ ํฅํ๊ณ ์๋ ๊ฒฝ์ฐ (ํผ์น๊ฐ -30๋ ์ดํ)
|
324 |
if (pitchAngle < -Math.PI / 6) {
|
325 |
-
abnormalG += 2.0 + Math.abs(pitchAngle + Math.PI / 6) * 3; //
|
|
|
|
|
|
|
|
|
|
|
326 |
}
|
327 |
|
328 |
// ๊ธ๊ฒฉํ ๊ธฐ๋์ ์ํ G-Force
|
@@ -363,9 +372,9 @@ class Fighter {
|
|
363 |
this.stallWarning = true;
|
364 |
}
|
365 |
|
366 |
-
// ์คํจ ํ์ถ ์กฐ๊ฑด:
|
367 |
-
if (this.stallWarning && this.
|
368 |
-
//
|
369 |
this.stallWarning = false;
|
370 |
}
|
371 |
|
@@ -758,7 +767,7 @@ class Game {
|
|
758 |
this.bgm = null;
|
759 |
this.bgmPlaying = false;
|
760 |
|
761 |
-
this.keys = { w: false, a: false, s: false, d: false };
|
762 |
this.isStarted = false;
|
763 |
|
764 |
this.setupScene();
|
@@ -935,6 +944,7 @@ class Game {
|
|
935 |
case 'KeyA': this.keys.a = true; break;
|
936 |
case 'KeyS': this.keys.s = true; break;
|
937 |
case 'KeyD': this.keys.d = true; break;
|
|
|
938 |
}
|
939 |
});
|
940 |
|
@@ -946,6 +956,7 @@ class Game {
|
|
946 |
case 'KeyA': this.keys.a = false; break;
|
947 |
case 'KeyS': this.keys.s = false; break;
|
948 |
case 'KeyD': this.keys.d = false; break;
|
|
|
949 |
}
|
950 |
});
|
951 |
|
@@ -1129,7 +1140,7 @@ class Game {
|
|
1129 |
text-align: center;
|
1130 |
animation: blink 0.5s infinite;
|
1131 |
`;
|
1132 |
-
stallEscapeWarning.innerHTML = 'PRESS
|
1133 |
document.body.appendChild(stallEscapeWarning);
|
1134 |
|
1135 |
// ์ ๋๋ฉ์ด์
์คํ์ผ ์ถ๊ฐ
|
|
|
311 |
const turnRate = Math.abs(bankTurnRate) * 100;
|
312 |
const pitchRate = Math.abs(this.rotation.x - this.targetPitch) * 10;
|
313 |
|
314 |
+
// ๊ณ ๋์ ๋ฐ๋ฅธ G-Force ์ฆ๊ฐ ๋ฐฐ์จ ๊ณ์ฐ
|
315 |
+
const altitudeInKm = this.position.y / 1000; // ๋ฏธํฐ๋ฅผ ํฌ๋ก๋ฏธํฐ๋ก ๋ณํ
|
316 |
+
const altitudeMultiplier = 1 + (altitudeInKm * 0.2); // 1km๋น 20% ์ฆ๊ฐ
|
317 |
+
|
318 |
// ๋น์ ์์ ์ธ ์์ธ์ ์ํ G-Force ์ถ๊ฐ
|
319 |
let abnormalG = 0;
|
320 |
|
321 |
// ๋ค์งํ ์ํ (๋กค์ด 90๋ ์ด์)
|
322 |
const isInverted = Math.abs(this.rotation.z) > Math.PI / 2;
|
323 |
if (isInverted) {
|
324 |
+
abnormalG += (3.0 + Math.abs(Math.abs(this.rotation.z) - Math.PI / 2) * 2) * altitudeMultiplier; // ๊ณ ๋ ๋ฐฐ์จ ์ ์ฉ
|
325 |
}
|
326 |
|
327 |
// ๊ธฐ์๊ฐ ๊ณ์ ์๋ฅผ ํฅํ๊ณ ์๋ ๊ฒฝ์ฐ (ํผ์น๊ฐ -30๋ ์ดํ)
|
328 |
if (pitchAngle < -Math.PI / 6) {
|
329 |
+
abnormalG += (2.0 + Math.abs(pitchAngle + Math.PI / 6) * 3) * altitudeMultiplier; // ๊ณ ๋ ๋ฐฐ์จ ์ ์ฉ
|
330 |
+
}
|
331 |
+
|
332 |
+
// ๊ธฐ์๊ฐ ๊ณผ๋ํ๊ฒ ์๋๋ฅผ ํฅํ๊ณ ์๋ ๊ฒฝ์ฐ (ํผ์น๊ฐ 60๋ ์ด์)
|
333 |
+
if (pitchAngle > Math.PI / 3) {
|
334 |
+
abnormalG += (2.0 + Math.abs(pitchAngle - Math.PI / 3) * 3) * altitudeMultiplier; // ๊ณ ๋ ๋ฐฐ์จ ์ ์ฉ
|
335 |
}
|
336 |
|
337 |
// ๊ธ๊ฒฉํ ๊ธฐ๋์ ์ํ G-Force
|
|
|
372 |
this.stallWarning = true;
|
373 |
}
|
374 |
|
375 |
+
// ์คํจ ํ์ถ ์กฐ๊ฑด: Fํค๋ฅผ ๋๋ฅด๊ณ ์๊ณ , ๊ธฐ์๊ฐ ์๋๋ฅผ ํฅํ๊ณ ์๊ณ , ์๋๊ฐ ์ถฉ๋ถํ ๋
|
376 |
+
if (this.stallWarning && this.keys.f && pitchAngle > 0.2 && speedKnots > GAME_CONSTANTS.STALL_SPEED + 50) {
|
377 |
+
// Fํค๋ฅผ ๋๋ฅด๊ณ ์์ ๋๋ง ์คํจ ํ์ถ
|
378 |
this.stallWarning = false;
|
379 |
}
|
380 |
|
|
|
767 |
this.bgm = null;
|
768 |
this.bgmPlaying = false;
|
769 |
|
770 |
+
this.keys = { w: false, a: false, s: false, d: false, f: false };
|
771 |
this.isStarted = false;
|
772 |
|
773 |
this.setupScene();
|
|
|
944 |
case 'KeyA': this.keys.a = true; break;
|
945 |
case 'KeyS': this.keys.s = true; break;
|
946 |
case 'KeyD': this.keys.d = true; break;
|
947 |
+
case 'KeyF': this.keys.f = true; break;
|
948 |
}
|
949 |
});
|
950 |
|
|
|
956 |
case 'KeyA': this.keys.a = false; break;
|
957 |
case 'KeyS': this.keys.s = false; break;
|
958 |
case 'KeyD': this.keys.d = false; break;
|
959 |
+
case 'KeyF': this.keys.f = false; break;
|
960 |
}
|
961 |
});
|
962 |
|
|
|
1140 |
text-align: center;
|
1141 |
animation: blink 0.5s infinite;
|
1142 |
`;
|
1143 |
+
stallEscapeWarning.innerHTML = 'PRESS F TO ESCAPE';
|
1144 |
document.body.appendChild(stallEscapeWarning);
|
1145 |
|
1146 |
// ์ ๋๋ฉ์ด์
์คํ์ผ ์ถ๊ฐ
|