cutechicken commited on
Commit
9676487
โ€ข
1 Parent(s): c0b45d7

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +10 -9
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
- if (window.gameInstance) {
201
- const spawnPos = window.gameInstance.findValidSpawnPosition();
202
- this.body.position.copy(spawnPos);
203
- } else {
204
- this.body.position.copy(this.position);
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) => {