cutechicken commited on
Commit
6227da5
Β·
verified Β·
1 Parent(s): a3ac463

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +4 -5
game.js CHANGED
@@ -716,7 +716,6 @@ class Fighter {
716
  }
717
  }
718
 
719
- // 적 μ „νˆ¬κΈ° 클래슀
720
  // 적 μ „νˆ¬κΈ° 클래슀 - μ™„μ „νžˆ μž¬μ„€κ³„
721
  class EnemyFighter {
722
  constructor(scene, position) {
@@ -1037,19 +1036,19 @@ class EnemyFighter {
1037
  });
1038
  const bullet = new THREE.Mesh(bulletGeometry, bulletMaterial);
1039
 
1040
- // 기수 λμ—μ„œ λ°œμ‚¬ (ν”Œλ ˆμ΄μ–΄μ™€ λ™μΌν•˜κ²Œ 더 μ•žμͺ½μ—μ„œ)
1041
- const muzzleOffset = new THREE.Vector3(0, 0, 10);
1042
  muzzleOffset.applyEuler(this.rotation);
1043
  bullet.position.copy(this.position).add(muzzleOffset);
1044
 
1045
  // νƒ„ν™˜μ„ λ°œμ‚¬ λ°©ν–₯으둜 νšŒμ „
1046
  bullet.rotation.copy(this.rotation);
1047
- bullet.rotateX(Math.PI / 2);
1048
 
1049
  // νƒ„ν™˜ 초기 μœ„μΉ˜ μ €μž₯
1050
  bullet.startPosition = bullet.position.clone();
1051
 
1052
- // νƒ„ν™˜ 속도 (ν”Œλ ˆμ΄μ–΄μ™€ λ™μΌν•˜κ²Œ 1500)
1053
  const direction = new THREE.Vector3(0, 0, 1);
1054
  direction.applyEuler(this.rotation);
1055
  bullet.velocity = direction.multiplyScalar(1500);
 
716
  }
717
  }
718
 
 
719
  // 적 μ „νˆ¬κΈ° 클래슀 - μ™„μ „νžˆ μž¬μ„€κ³„
720
  class EnemyFighter {
721
  constructor(scene, position) {
 
1036
  });
1037
  const bullet = new THREE.Mesh(bulletGeometry, bulletMaterial);
1038
 
1039
+ // 기수 λμ—μ„œλ§Œ λ°œμ‚¬ - μ •ν™•νžˆ μ „λ°© μ€‘μ•™μ—μ„œ
1040
+ const muzzleOffset = new THREE.Vector3(0, 0, 10); // X=0, Y=0으둜 쀑앙 κ³ μ •
1041
  muzzleOffset.applyEuler(this.rotation);
1042
  bullet.position.copy(this.position).add(muzzleOffset);
1043
 
1044
  // νƒ„ν™˜μ„ λ°œμ‚¬ λ°©ν–₯으둜 νšŒμ „
1045
  bullet.rotation.copy(this.rotation);
1046
+ bullet.rotateX(Math.PI / 2); // 싀린더가 ZμΆ• λ°©ν–₯을 ν–₯ν•˜λ„λ‘
1047
 
1048
  // νƒ„ν™˜ 초기 μœ„μΉ˜ μ €μž₯
1049
  bullet.startPosition = bullet.position.clone();
1050
 
1051
+ // νƒ„ν™˜ 속도 (ν”Œλ ˆμ΄μ–΄μ™€ λ™μΌν•˜κ²Œ 1500) - μ •ν™•νžˆ μ „λ°©μœΌλ‘œ
1052
  const direction = new THREE.Vector3(0, 0, 1);
1053
  direction.applyEuler(this.rotation);
1054
  bullet.velocity = direction.multiplyScalar(1500);