cutechicken commited on
Commit
7aaeb16
β€’
1 Parent(s): 0e11cb1

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +5 -3
game.js CHANGED
@@ -180,9 +180,10 @@ class TankPlayer {
180
  flashGroup.add(smoke);
181
  }
182
 
183
- // μœ„μΉ˜ μ„€μ • (포탑 끝)
184
- const muzzlePosition = new THREE.Vector3(0, 0, 2); // 포탑 끝 μƒλŒ€ μ’Œν‘œ
185
- this.turret.getWorldPosition(muzzlePosition); // 포탑 끝의 μ „μ—­ μ’Œν‘œ 계산
 
186
  flashGroup.position.copy(muzzlePosition);
187
 
188
  // 씬에 μΆ”κ°€
@@ -196,6 +197,7 @@ class TankPlayer {
196
 
197
 
198
 
 
199
  createBullet(scene) {
200
  const bulletGeometry = new THREE.CylinderGeometry(0.1, 0.1, 1, 8);
201
  const bulletMaterial = new THREE.MeshBasicMaterial({ color: 0xffd700 });
 
180
  flashGroup.add(smoke);
181
  }
182
 
183
+ // 포탑 끝의 μ „μ—­ μ’Œν‘œ 계산
184
+ const muzzlePosition = new THREE.Vector3(0, 0, 2); // 포탑 끝의 둜컬 μ’Œν‘œ (ν¬μ‹ μ˜ 끝)
185
+ this.turret.localToWorld(muzzlePosition); // 둜컬 μ’Œν‘œλ₯Ό μ „μ—­ μ’Œν‘œλ‘œ λ³€ν™˜
186
+
187
  flashGroup.position.copy(muzzlePosition);
188
 
189
  // 씬에 μΆ”κ°€
 
197
 
198
 
199
 
200
+
201
  createBullet(scene) {
202
  const bulletGeometry = new THREE.CylinderGeometry(0.1, 0.1, 1, 8);
203
  const bulletMaterial = new THREE.MeshBasicMaterial({ color: 0xffd700 });