Spaces:
Running
Running
cutechicken
commited on
Commit
โข
ffe7897
1
Parent(s):
60a1fa9
Update game.js
Browse files
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;
|