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