cutechicken commited on
Commit
7bb432f
β€’
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),