Update game.js
Browse files
game.js
CHANGED
|
@@ -166,7 +166,7 @@ class TankPlayer {
|
|
| 166 |
this.turretGroup.add(this.turret);
|
| 167 |
this.body.add(this.turretGroup);
|
| 168 |
|
| 169 |
-
// ๊ทธ๋ฆผ์
|
| 170 |
this.body.traverse((child) => {
|
| 171 |
if (child.isMesh) {
|
| 172 |
child.castShadow = true;
|
|
@@ -185,7 +185,7 @@ class TankPlayer {
|
|
| 185 |
}
|
| 186 |
});
|
| 187 |
|
| 188 |
-
//
|
| 189 |
const shadowPlaneGeometry = new THREE.PlaneGeometry(8, 8);
|
| 190 |
const shadowPlaneMaterial = new THREE.ShadowMaterial({
|
| 191 |
opacity: 0.3
|
|
@@ -196,13 +196,14 @@ class TankPlayer {
|
|
| 196 |
this.shadowPlane.position.y = 0.1;
|
| 197 |
this.body.add(this.shadowPlane);
|
| 198 |
|
| 199 |
-
//
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
|
|
|
| 206 |
|
| 207 |
// ํญ๋ฐ ์ดํํธ ๋ฉ์๋ ์ถ๊ฐ
|
| 208 |
this.createExplosionEffect = (scene, position) => {
|
|
|
|
| 166 |
this.turretGroup.add(this.turret);
|
| 167 |
this.body.add(this.turretGroup);
|
| 168 |
|
| 169 |
+
// ๊ทธ๋ฆผ์ ์ค์ ์ ๊ทธ๋๋ก ์ ์ง
|
| 170 |
this.body.traverse((child) => {
|
| 171 |
if (child.isMesh) {
|
| 172 |
child.castShadow = true;
|
|
|
|
| 185 |
}
|
| 186 |
});
|
| 187 |
|
| 188 |
+
// ๊ทธ๋ฆผ์ ํ๋ฉด
|
| 189 |
const shadowPlaneGeometry = new THREE.PlaneGeometry(8, 8);
|
| 190 |
const shadowPlaneMaterial = new THREE.ShadowMaterial({
|
| 191 |
opacity: 0.3
|
|
|
|
| 196 |
this.shadowPlane.position.y = 0.1;
|
| 197 |
this.body.add(this.shadowPlane);
|
| 198 |
|
| 199 |
+
// ๊ฐ๋จํ ์คํฐ ์์น ์ค์
|
| 200 |
+
const spawnPosition = new THREE.Vector3(
|
| 201 |
+
(Math.random() - 0.5) * (MAP_SIZE * 0.8), // MAP_SIZE์ 80%๋ง ์ฌ์ฉ
|
| 202 |
+
TANK_HEIGHT, // ๊ณ ์ ๋ ๋์ด ์ฌ์ฉ
|
| 203 |
+
(Math.random() - 0.5) * (MAP_SIZE * 0.8)
|
| 204 |
+
);
|
| 205 |
+
|
| 206 |
+
this.body.position.copy(spawnPosition);
|
| 207 |
|
| 208 |
// ํญ๋ฐ ์ดํํธ ๋ฉ์๋ ์ถ๊ฐ
|
| 209 |
this.createExplosionEffect = (scene, position) => {
|