cutechicken commited on
Commit
bb76419
·
verified ·
1 Parent(s): 7fea2cd

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +30 -0
game.js CHANGED
@@ -676,6 +676,36 @@ class Game {
676
  location.reload(); // 게임 자동 재시작
677
  return;
678
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
679
 
680
  // 카메라 초기 위치 설정
681
  const tankPosition = this.tank.getPosition();
 
676
  location.reload(); // 게임 자동 재시작
677
  return;
678
  }
679
+ createMapBoundary() {
680
+ const boundaryGeometry = new THREE.BoxGeometry(1, 20, MAP_SIZE);
681
+ const boundaryMaterial = new THREE.MeshPhongMaterial({
682
+ color: 0x808080,
683
+ transparent: true,
684
+ opacity: 0.5
685
+ });
686
+
687
+ // 동쪽 벽
688
+ const eastWall = new THREE.Mesh(boundaryGeometry, boundaryMaterial);
689
+ eastWall.position.set(MAP_SIZE/2, 10, 0);
690
+ this.scene.add(eastWall);
691
+
692
+ // 서쪽 벽
693
+ const westWall = new THREE.Mesh(boundaryGeometry, boundaryMaterial);
694
+ westWall.position.set(-MAP_SIZE/2, 10, 0);
695
+ this.scene.add(westWall);
696
+
697
+ // 북쪽 벽
698
+ const northWall = new THREE.Mesh(boundaryGeometry, boundaryMaterial);
699
+ northWall.rotation.y = Math.PI/2;
700
+ northWall.position.set(0, 10, MAP_SIZE/2);
701
+ this.scene.add(northWall);
702
+
703
+ // 남쪽 벽
704
+ const southWall = new THREE.Mesh(boundaryGeometry, boundaryMaterial);
705
+ southWall.rotation.y = Math.PI/2;
706
+ southWall.position.set(0, 10, -MAP_SIZE/2);
707
+ this.scene.add(southWall);
708
+ }
709
 
710
  // 카메라 초기 위치 설정
711
  const tankPosition = this.tank.getPosition();