cutechicken commited on
Commit
599fddd
ยท
verified ยท
1 Parent(s): 819ac52

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +18 -7
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; // ๊ธฐ๋ณธ 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
@@ -363,9 +372,9 @@ class Fighter {
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
 
@@ -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 W TO ESCAPE';
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
  // ์• ๋‹ˆ๋ฉ”์ด์…˜ ์Šคํƒ€์ผ ์ถ”๊ฐ€