cutechicken commited on
Commit
ffe7897
โ€ข
1 Parent(s): 60a1fa9

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +12 -9
game.js CHANGED
@@ -1434,14 +1434,7 @@ this.scene.add(ground);
1434
 
1435
  checkCollisions() {
1436
  if (this.isLoading || !this.tank.isLoaded) return;
1437
- // ํƒฑํฌ์™€ ์žฅ์• ๋ฌผ ์ถฉ๋Œ ์ฒดํฌ
1438
- const tankBoundingBox = new THREE.Box3().setFromObject(this.tank.body);
1439
- this.obstacles.forEach(obstacle => {
1440
- const obstacleBoundingBox = new THREE.Box3().setFromObject(obstacle);
1441
- if (tankBoundingBox.intersectsBox(obstacleBoundingBox)) {
1442
- const tankPosition = this.tank.getPosition();
1443
- //
1444
- }
1445
  // ๋ช…์ค‘ ์‚ฌ์šด๋“œ ๋ฐฐ์—ด ์ •์˜
1446
  const hitSounds = [
1447
  'sounds/hit1.ogg', 'sounds/hit2.ogg', 'sounds/hit3.ogg',
@@ -1450,7 +1443,17 @@ this.scene.add(ground);
1450
 
1451
  // ํ”ผ๊ฒฉ ์‚ฌ์šด๋“œ ๋ฐฐ์—ด ์ •์˜
1452
  const beatSounds = ['sounds/beat1.ogg', 'sounds/beat2.ogg', 'sounds/beat3.ogg'];
1453
-
 
 
 
 
 
 
 
 
 
 
1454
  // ์  ์ด์•Œ๊ณผ ํ”Œ๋ ˆ์ด์–ด ํƒฑํฌ ์ถฉ๋Œ ์ฒดํฌ
1455
  this.enemies.forEach(enemy => {
1456
  if (!enemy.mesh || !enemy.isLoaded) return;
 
1434
 
1435
  checkCollisions() {
1436
  if (this.isLoading || !this.tank.isLoaded) return;
1437
+
 
 
 
 
 
 
 
1438
  // ๋ช…์ค‘ ์‚ฌ์šด๋“œ ๋ฐฐ์—ด ์ •์˜
1439
  const hitSounds = [
1440
  'sounds/hit1.ogg', 'sounds/hit2.ogg', 'sounds/hit3.ogg',
 
1443
 
1444
  // ํ”ผ๊ฒฉ ์‚ฌ์šด๋“œ ๋ฐฐ์—ด ์ •์˜
1445
  const beatSounds = ['sounds/beat1.ogg', 'sounds/beat2.ogg', 'sounds/beat3.ogg'];
1446
+
1447
+ // ํƒฑํฌ์™€ ์žฅ์• ๋ฌผ ์ถฉ๋Œ ์ฒดํฌ
1448
+ const tankBoundingBox = new THREE.Box3().setFromObject(this.tank.body);
1449
+ this.obstacles.forEach(obstacle => {
1450
+ const obstacleBoundingBox = new THREE.Box3().setFromObject(obstacle);
1451
+ if (tankBoundingBox.intersectsBox(obstacleBoundingBox)) {
1452
+ const tankPosition = this.tank.getPosition();
1453
+ //
1454
+ }
1455
+ }
1456
+ //์ด๊ฑฐ ์ฒดํฌ});
1457
  // ์  ์ด์•Œ๊ณผ ํ”Œ๋ ˆ์ด์–ด ํƒฑํฌ ์ถฉ๋Œ ์ฒดํฌ
1458
  this.enemies.forEach(enemy => {
1459
  if (!enemy.mesh || !enemy.isLoaded) return;