Spaces:
Running
Running
Update game.js
Browse files
game.js
CHANGED
@@ -307,10 +307,35 @@ class Fighter {
|
|
307 |
targetSpeed *= (1 + diveFactor * 0.4); // ํ๊ฐ ์ ๊ฐ์ ์ฆ๊ฐ (0.2 -> 0.4)
|
308 |
}
|
309 |
|
310 |
-
//
|
311 |
const turnRate = Math.abs(bankTurnRate) * 100;
|
312 |
const pitchRate = Math.abs(this.rotation.x - this.targetPitch) * 10;
|
313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
|
315 |
this.overG = this.gForce > this.maxGForce;
|
316 |
|
@@ -332,14 +357,16 @@ class Fighter {
|
|
332 |
// ์คํจ ๊ฒฝ๊ณ : 300kt ์ดํ์์ ์คํจ ์ํ
|
333 |
const speedKnots = this.speed * 1.94384; // m/s to knots
|
334 |
const wasStalling = this.stallWarning;
|
335 |
-
this.stallWarning = speedKnots < GAME_CONSTANTS.STALL_SPEED;
|
336 |
|
337 |
-
// ์คํจ
|
338 |
-
if (this.stallWarning &&
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
|
|
|
|
|
|
343 |
}
|
344 |
|
345 |
// ์๋ ๋ณํ ์ ์ฉ
|
|
|
307 |
targetSpeed *= (1 + diveFactor * 0.4); // ํ๊ฐ ์ ๊ฐ์ ์ฆ๊ฐ (0.2 -> 0.4)
|
308 |
}
|
309 |
|
310 |
+
// G-Force ๊ณ์ฐ ๊ฐ์
|
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; // ๊ธฐ๋ณธ 3G + ์ถ๊ฐ
|
321 |
+
}
|
322 |
+
|
323 |
+
// ๊ธฐ์๊ฐ ๊ณ์ ์๋ฅผ ํฅํ๊ณ ์๋ ๊ฒฝ์ฐ (ํผ์น๊ฐ -30๋ ์ดํ)
|
324 |
+
if (pitchAngle < -Math.PI / 6) {
|
325 |
+
abnormalG += 2.0 + Math.abs(pitchAngle + Math.PI / 6) * 3; // ๊ธฐ๋ณธ 2G + ์ถ๊ฐ
|
326 |
+
}
|
327 |
+
|
328 |
+
// ๊ธ๊ฒฉํ ๊ธฐ๋์ ์ํ G-Force
|
329 |
+
const maneuverG = turnRate + pitchRate + (Math.abs(this.rotation.z) * 3);
|
330 |
+
|
331 |
+
// ์ด G-Force ๊ณ์ฐ
|
332 |
+
this.gForce = 1.0 + maneuverG + abnormalG;
|
333 |
+
|
334 |
+
// ์ ์ ์์ธ๋ก ๋์์ค๋ฉด G-Force ์์ฐ์ค๋ฝ๊ฒ ๊ฐ์
|
335 |
+
if (!isInverted && pitchAngle > -Math.PI / 6 && pitchAngle < Math.PI / 6) {
|
336 |
+
// ์ ์ ์์ธ์ผ ๋ G-Force๋ฅผ ๋ถ๋๋ฝ๊ฒ ๊ฐ์
|
337 |
+
this.gForce = THREE.MathUtils.lerp(this.gForce, 1.0 + maneuverG, deltaTime * 2.0);
|
338 |
+
}
|
339 |
|
340 |
this.overG = this.gForce > this.maxGForce;
|
341 |
|
|
|
357 |
// ์คํจ ๊ฒฝ๊ณ : 300kt ์ดํ์์ ์คํจ ์ํ
|
358 |
const speedKnots = this.speed * 1.94384; // m/s to knots
|
359 |
const wasStalling = this.stallWarning;
|
|
|
360 |
|
361 |
+
// ์คํจ ์ง์
์กฐ๊ฑด
|
362 |
+
if (!this.stallWarning && speedKnots < GAME_CONSTANTS.STALL_SPEED) {
|
363 |
+
this.stallWarning = true;
|
364 |
+
}
|
365 |
+
|
366 |
+
// ์คํจ ํ์ถ ์กฐ๊ฑด: Wํค๋ฅผ ๋๋ฅด๊ณ ์๊ณ , ๊ธฐ์๊ฐ ์๋๋ฅผ ํฅํ๊ณ ์๊ณ , ์๋๊ฐ ์ถฉ๋ถํ ๋
|
367 |
+
if (this.stallWarning && this.throttle > 0.8 && pitchAngle > 0.2 && speedKnots > GAME_CONSTANTS.STALL_SPEED + 50) {
|
368 |
+
// Wํค๋ฅผ ๋๋ฅด๊ณ ์์ ๋๋ง ์คํจ ํ์ถ
|
369 |
+
this.stallWarning = false;
|
370 |
}
|
371 |
|
372 |
// ์๋ ๋ณํ ์ ์ฉ
|