cutechicken commited on
Commit
7bb432f
ยท
verified ยท
1 Parent(s): 1506433

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +7 -0
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),