cutechicken commited on
Commit
819ac52
ยท
verified ยท
1 Parent(s): 4032e5a

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +36 -9
game.js CHANGED
@@ -307,10 +307,35 @@ class Fighter {
307
  targetSpeed *= (1 + diveFactor * 0.4); // ํ•˜๊ฐ• ์‹œ ๊ฐ€์† ์ฆ๊ฐ€ (0.2 -> 0.4)
308
  }
309
 
310
- // Over-G ์ƒํƒœ ์ฒ˜๋ฆฌ
311
  const turnRate = Math.abs(bankTurnRate) * 100;
312
  const pitchRate = Math.abs(this.rotation.x - this.targetPitch) * 10;
313
- this.gForce = 1.0 + turnRate + pitchRate + (Math.abs(this.rotation.z) * 3);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
- // ์Šคํ†จ ํƒˆ์ถœ ์กฐ๊ฑด: Wํ‚ค๋ฅผ ๋ˆ„๋ฅด๊ณ  ์žˆ๊ณ , ๊ธฐ์ˆ˜๊ฐ€ ์•„๋ž˜๋ฅผ ํ–ฅํ•˜๊ณ  ์žˆ์„ ๋•Œ
338
- if (this.stallWarning && this.throttle > 0.8 && pitchAngle > 0.2) {
339
- // ๋‹ค์ด๋น™ ์ค‘์— ์†๋„๊ฐ€ ํšŒ๋ณต๋˜๋ฉด ์Šคํ†จ ํƒˆ์ถœ
340
- if (speedKnots > GAME_CONSTANTS.STALL_SPEED + 50) { // 350kt ์ด์ƒ
341
- this.stallWarning = false;
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
  // ์†๋„ ๋ณ€ํ™” ์ ์šฉ