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

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +7 -1
game.js CHANGED
@@ -60,6 +60,9 @@ class Fighter {
60
  this.bullets = [];
61
  this.lastShootTime = 0;
62
 
 
 
 
63
  // ์นด๋ฉ”๋ผ ์„ค์ •
64
  this.cameraDistance = 250;
65
  this.cameraHeight = 30;
@@ -373,7 +376,7 @@ class Fighter {
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
  }
@@ -1271,6 +1274,9 @@ class Game {
1271
  this.lastTime = currentTime;
1272
 
1273
  if (this.isLoaded && this.fighter.isLoaded) {
 
 
 
1274
  this.fighter.updateControls(this.keys, deltaTime);
1275
  this.fighter.updatePhysics(deltaTime);
1276
  this.fighter.updateBullets(this.scene, deltaTime);
 
60
  this.bullets = [];
61
  this.lastShootTime = 0;
62
 
63
+ // ์Šคํ†จ ํƒˆ์ถœ์„ ์œ„ํ•œ Fํ‚ค ์ƒํƒœ
64
+ this.escapeKeyPressed = false;
65
+
66
  // ์นด๋ฉ”๋ผ ์„ค์ •
67
  this.cameraDistance = 250;
68
  this.cameraHeight = 30;
 
376
  }
377
 
378
  // ์Šคํ†จ ํƒˆ์ถœ ์กฐ๊ฑด: Fํ‚ค๋ฅผ ๋ˆ„๋ฅด๊ณ  ์žˆ๊ณ , ๊ธฐ์ˆ˜๊ฐ€ ์•„๋ž˜๋ฅผ ํ–ฅํ•˜๊ณ  ์žˆ๊ณ , ์†๋„๊ฐ€ ์ถฉ๋ถ„ํ•  ๋•Œ
379
+ if (this.stallWarning && this.escapeKeyPressed && pitchAngle > 0.2 && speedKnots > GAME_CONSTANTS.STALL_SPEED + 50) {
380
  // Fํ‚ค๋ฅผ ๋ˆ„๋ฅด๊ณ  ์žˆ์„ ๋•Œ๋งŒ ์Šคํ†จ ํƒˆ์ถœ
381
  this.stallWarning = false;
382
  }
 
1274
  this.lastTime = currentTime;
1275
 
1276
  if (this.isLoaded && this.fighter.isLoaded) {
1277
+ // Fํ‚ค ์ƒํƒœ๋ฅผ Fighter์— ์ „๋‹ฌ
1278
+ this.fighter.escapeKeyPressed = this.keys.f;
1279
+
1280
  this.fighter.updateControls(this.keys, deltaTime);
1281
  this.fighter.updatePhysics(deltaTime);
1282
  this.fighter.updateBullets(this.scene, deltaTime);