Spaces:
Running
Running
cutechicken
commited on
Commit
β’
7bb432f
1
Parent(s):
1506433
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),
|