Spaces:
Running
Running
Update game.js
Browse files
game.js
CHANGED
@@ -39,6 +39,9 @@ class TankPlayer {
|
|
39 |
this.lastShootTime = 0;
|
40 |
this.bullets = [];
|
41 |
this.obstacles = [];
|
|
|
|
|
|
|
42 |
}
|
43 |
// ๋ณ๋์ ๋ฉ์๋๋ก ๋ถ๋ฆฌ
|
44 |
createExplosionEffect(scene, position) {
|
@@ -1024,6 +1027,10 @@ class Game {
|
|
1024 |
}
|
1025 |
|
1026 |
async addDesertDecorations() {
|
|
|
|
|
|
|
|
|
1027 |
// ๋ฐ์ ์์ฑ
|
1028 |
const rockGeometries = [
|
1029 |
new THREE.DodecahedronGeometry(3),
|
|
|
39 |
this.lastShootTime = 0;
|
40 |
this.bullets = [];
|
41 |
this.obstacles = [];
|
42 |
+
this.scene = new THREE.Scene();
|
43 |
+
this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
|
44 |
+
this.renderer = new THREE.WebGLRenderer({ antialias: true });
|
45 |
}
|
46 |
// ๋ณ๋์ ๋ฉ์๋๋ก ๋ถ๋ฆฌ
|
47 |
createExplosionEffect(scene, position) {
|
|
|
1027 |
}
|
1028 |
|
1029 |
async addDesertDecorations() {
|
1030 |
+
if (!this.obstacles) {
|
1031 |
+
this.obstacles = []; // ๋ฐฐ์ด์ด ์์ผ๋ฉด ์ด๊ธฐํ
|
1032 |
+
}
|
1033 |
+
|
1034 |
// ๋ฐ์ ์์ฑ
|
1035 |
const rockGeometries = [
|
1036 |
new THREE.DodecahedronGeometry(3),
|