Spaces:
Running
Running
Update game.js
Browse files
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.
|
|
|
|
| 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 });
|