Spaces:
Running
Running
Update game.js
Browse files
game.js
CHANGED
|
@@ -800,6 +800,31 @@ class Game {
|
|
| 800 |
this.initialize();
|
| 801 |
this.obstacles = []; // obstacles 배열 추가
|
| 802 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 803 |
|
| 804 |
async initialize() {
|
| 805 |
try {
|
|
|
|
| 800 |
this.initialize();
|
| 801 |
this.obstacles = []; // obstacles 배열 추가
|
| 802 |
}
|
| 803 |
+
setupScene() {
|
| 804 |
+
// 씬 초기화
|
| 805 |
+
this.scene.background = new THREE.Color(0x87CEEB); // 하늘색 배경
|
| 806 |
+
|
| 807 |
+
// 안개 설정
|
| 808 |
+
this.scene.fog = new THREE.FogExp2(0x87CEEB, 0.0008);
|
| 809 |
+
|
| 810 |
+
// 렌더러 설정
|
| 811 |
+
this.renderer.shadowMap.enabled = true;
|
| 812 |
+
this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
| 813 |
+
this.renderer.setPixelRatio(window.devicePixelRatio);
|
| 814 |
+
|
| 815 |
+
// 카메라 초기 설정
|
| 816 |
+
this.camera.position.set(0, 15, -30);
|
| 817 |
+
this.camera.lookAt(0, 0, 0);
|
| 818 |
+
|
| 819 |
+
// 씬 경계 설정
|
| 820 |
+
const mapBoundary = MAP_SIZE / 2;
|
| 821 |
+
this.sceneBounds = {
|
| 822 |
+
minX: -mapBoundary,
|
| 823 |
+
maxX: mapBoundary,
|
| 824 |
+
minZ: -mapBoundary,
|
| 825 |
+
maxZ: mapBoundary
|
| 826 |
+
};
|
| 827 |
+
}
|
| 828 |
|
| 829 |
async initialize() {
|
| 830 |
try {
|