Spaces:
Running
Running
cutechicken
commited on
Commit
β’
85020fd
1
Parent(s):
71f9ded
Update game.js
Browse files
game.js
CHANGED
@@ -1189,8 +1189,8 @@ checkPathClear(start, end) {
|
|
1189 |
// μ€μ¬ νλ°
|
1190 |
const explosionGroup = new THREE.Group();
|
1191 |
|
1192 |
-
// μ£Ό νλ° νλμ
|
1193 |
-
const flashGeometry = new THREE.SphereGeometry(
|
1194 |
const flashMaterial = new THREE.MeshBasicMaterial({
|
1195 |
color: 0xffff00,
|
1196 |
transparent: true,
|
@@ -1200,13 +1200,13 @@ checkPathClear(start, end) {
|
|
1200 |
flash.position.copy(this.mesh.position);
|
1201 |
this.scene.add(flash);
|
1202 |
|
1203 |
-
// λ€μ€ νλ° νν°ν΄
|
1204 |
-
for (let i = 0; i <
|
1205 |
-
const size = Math.random() *
|
1206 |
const geometry = new THREE.SphereGeometry(size);
|
1207 |
|
1208 |
// λ€μν νλ° μμ
|
1209 |
-
const colors = [0xff4500, 0xff8c00, 0xff0000, 0xffd700
|
1210 |
const material = new THREE.MeshBasicMaterial({
|
1211 |
color: colors[Math.floor(Math.random() * colors.length)],
|
1212 |
transparent: true,
|
@@ -1216,8 +1216,8 @@ checkPathClear(start, end) {
|
|
1216 |
const particle = new THREE.Mesh(geometry, material);
|
1217 |
particle.position.copy(this.mesh.position);
|
1218 |
|
1219 |
-
//
|
1220 |
-
const speed = Math.random() *
|
1221 |
const angle = Math.random() * Math.PI * 2;
|
1222 |
const elevation = Math.random() * Math.PI - Math.PI / 2;
|
1223 |
|
@@ -1227,8 +1227,8 @@ checkPathClear(start, end) {
|
|
1227 |
Math.sin(angle) * Math.cos(elevation) * speed
|
1228 |
);
|
1229 |
|
1230 |
-
particle.gravity = -0.
|
1231 |
-
particle.life = Math.random() *
|
1232 |
particle.fadeRate = 0.98;
|
1233 |
|
1234 |
this.scene.add(particle);
|
@@ -1241,9 +1241,9 @@ checkPathClear(start, end) {
|
|
1241 |
});
|
1242 |
}
|
1243 |
|
1244 |
-
// νλ° λ§ μ΄ννΈ
|
1245 |
-
for (let i = 0; i <
|
1246 |
-
const ringGeometry = new THREE.RingGeometry(0.1,
|
1247 |
const ringMaterial = new THREE.MeshBasicMaterial({
|
1248 |
color: 0xff8c00,
|
1249 |
transparent: true,
|
@@ -1256,10 +1256,10 @@ checkPathClear(start, end) {
|
|
1256 |
ring.rotation.y = Math.random() * Math.PI;
|
1257 |
this.scene.add(ring);
|
1258 |
|
1259 |
-
// λ§ νμ₯ μ λλ©μ΄μ
|
1260 |
const expandRing = () => {
|
1261 |
-
ring.scale.x += 0.3
|
1262 |
-
ring.scale.y += 0.
|
1263 |
ring.material.opacity *= 0.96;
|
1264 |
|
1265 |
if (ring.material.opacity > 0.01) {
|
@@ -1271,17 +1271,17 @@ checkPathClear(start, end) {
|
|
1271 |
expandRing();
|
1272 |
}
|
1273 |
|
1274 |
-
// νμΌ κΈ°λ₯ ν¨κ³Ό
|
1275 |
const fireColumn = new THREE.Group();
|
1276 |
-
for (let i = 0; i <
|
1277 |
-
const fireGeometry = new THREE.ConeGeometry(
|
1278 |
const fireMaterial = new THREE.MeshBasicMaterial({
|
1279 |
color: 0xff4500,
|
1280 |
transparent: true,
|
1281 |
opacity: 0.8
|
1282 |
});
|
1283 |
const fire = new THREE.Mesh(fireGeometry, fireMaterial);
|
1284 |
-
fire.position.y = i * 0.5
|
1285 |
fire.rotation.x = Math.random() * Math.PI;
|
1286 |
fire.rotation.z = Math.random() * Math.PI;
|
1287 |
fireColumn.add(fire);
|
@@ -1289,9 +1289,9 @@ checkPathClear(start, end) {
|
|
1289 |
fireColumn.position.copy(this.mesh.position);
|
1290 |
this.scene.add(fireColumn);
|
1291 |
|
1292 |
-
// νμΌ κΈ°λ₯ μ λλ©μ΄μ
|
1293 |
const animateFireColumn = () => {
|
1294 |
-
fireColumn.scale.y += 0.1
|
1295 |
fireColumn.children.forEach(fire => {
|
1296 |
fire.material.opacity *= 0.95;
|
1297 |
});
|
@@ -1304,7 +1304,7 @@ checkPathClear(start, end) {
|
|
1304 |
};
|
1305 |
animateFireColumn();
|
1306 |
|
1307 |
-
// νλ° μ¬μ΄λ
|
1308 |
const explosionSounds = [
|
1309 |
new Audio('sounds/explosion.ogg'),
|
1310 |
new Audio('sounds/bang.ogg')
|
@@ -1314,13 +1314,13 @@ checkPathClear(start, end) {
|
|
1314 |
sound.play();
|
1315 |
});
|
1316 |
|
1317 |
-
// μΉ΄λ©λΌ νλ€λ¦Ό ν¨κ³Ό
|
1318 |
if (window.gameInstance && window.gameInstance.camera) {
|
1319 |
const camera = window.gameInstance.camera;
|
1320 |
const originalPosition = camera.position.clone();
|
1321 |
let shakeTime = 0;
|
1322 |
-
const shakeIntensity = 1.0
|
1323 |
-
const shakeDuration = 1000
|
1324 |
|
1325 |
const shakeCamera = () => {
|
1326 |
if (shakeTime < shakeDuration) {
|
@@ -1340,7 +1340,7 @@ checkPathClear(start, end) {
|
|
1340 |
// μ€μ¬ νλμ μ κ±°
|
1341 |
setTimeout(() => {
|
1342 |
this.scene.remove(flash);
|
1343 |
-
},
|
1344 |
}
|
1345 |
|
1346 |
|
|
|
1189 |
// μ€μ¬ νλ°
|
1190 |
const explosionGroup = new THREE.Group();
|
1191 |
|
1192 |
+
// μ£Ό νλ° νλμ (ν¬κΈ° κ°μ)
|
1193 |
+
const flashGeometry = new THREE.SphereGeometry(4); // 8μμ 4λ‘ κ°μ
|
1194 |
const flashMaterial = new THREE.MeshBasicMaterial({
|
1195 |
color: 0xffff00,
|
1196 |
transparent: true,
|
|
|
1200 |
flash.position.copy(this.mesh.position);
|
1201 |
this.scene.add(flash);
|
1202 |
|
1203 |
+
// λ€μ€ νλ° νν°ν΄ (μμ ν¬κΈ° κ°μ)
|
1204 |
+
for (let i = 0; i < 50; i++) { // 100μμ 50μΌλ‘ κ°μ
|
1205 |
+
const size = Math.random() * 1 + 0.5; // ν¬κΈ° λ²μ κ°μ
|
1206 |
const geometry = new THREE.SphereGeometry(size);
|
1207 |
|
1208 |
// λ€μν νλ° μμ
|
1209 |
+
const colors = [0xff4500, 0xff8c00, 0xff0000, 0xffd700];
|
1210 |
const material = new THREE.MeshBasicMaterial({
|
1211 |
color: colors[Math.floor(Math.random() * colors.length)],
|
1212 |
transparent: true,
|
|
|
1216 |
const particle = new THREE.Mesh(geometry, material);
|
1217 |
particle.position.copy(this.mesh.position);
|
1218 |
|
1219 |
+
// νν°ν΄ μλ κ°μ
|
1220 |
+
const speed = Math.random() * 1 + 0.5; // μλ λ²μ κ°μ
|
1221 |
const angle = Math.random() * Math.PI * 2;
|
1222 |
const elevation = Math.random() * Math.PI - Math.PI / 2;
|
1223 |
|
|
|
1227 |
Math.sin(angle) * Math.cos(elevation) * speed
|
1228 |
);
|
1229 |
|
1230 |
+
particle.gravity = -0.05; // μ€λ ₯ ν¨κ³Ό κ°μ
|
1231 |
+
particle.life = Math.random() * 30 + 30; // μλͺ
κ°μ
|
1232 |
particle.fadeRate = 0.98;
|
1233 |
|
1234 |
this.scene.add(particle);
|
|
|
1241 |
});
|
1242 |
}
|
1243 |
|
1244 |
+
// νλ° λ§ μ΄ννΈ (ν¬κΈ°μ νμ₯ μλ κ°μ)
|
1245 |
+
for (let i = 0; i < 2; i++) { // 3μμ 2λ‘ κ°μ
|
1246 |
+
const ringGeometry = new THREE.RingGeometry(0.1, 2, 32);
|
1247 |
const ringMaterial = new THREE.MeshBasicMaterial({
|
1248 |
color: 0xff8c00,
|
1249 |
transparent: true,
|
|
|
1256 |
ring.rotation.y = Math.random() * Math.PI;
|
1257 |
this.scene.add(ring);
|
1258 |
|
1259 |
+
// λ§ νμ₯ μ λλ©μ΄μ
(νμ₯ μλ κ°μ)
|
1260 |
const expandRing = () => {
|
1261 |
+
ring.scale.x += 0.15; // 0.3μμ 0.15λ‘ κ°μ
|
1262 |
+
ring.scale.y += 0.15;
|
1263 |
ring.material.opacity *= 0.96;
|
1264 |
|
1265 |
if (ring.material.opacity > 0.01) {
|
|
|
1271 |
expandRing();
|
1272 |
}
|
1273 |
|
1274 |
+
// νμΌ κΈ°λ₯ ν¨κ³Ό (ν¬κΈ°μ μ κ°μ)
|
1275 |
const fireColumn = new THREE.Group();
|
1276 |
+
for (let i = 0; i < 10; i++) { // 20μμ 10μΌλ‘ κ°μ
|
1277 |
+
const fireGeometry = new THREE.ConeGeometry(1, 4, 8); // ν¬κΈ° κ°μ
|
1278 |
const fireMaterial = new THREE.MeshBasicMaterial({
|
1279 |
color: 0xff4500,
|
1280 |
transparent: true,
|
1281 |
opacity: 0.8
|
1282 |
});
|
1283 |
const fire = new THREE.Mesh(fireGeometry, fireMaterial);
|
1284 |
+
fire.position.y = i * 0.3; // 0.5μμ 0.3μΌλ‘ κ°μ
|
1285 |
fire.rotation.x = Math.random() * Math.PI;
|
1286 |
fire.rotation.z = Math.random() * Math.PI;
|
1287 |
fireColumn.add(fire);
|
|
|
1289 |
fireColumn.position.copy(this.mesh.position);
|
1290 |
this.scene.add(fireColumn);
|
1291 |
|
1292 |
+
// νμΌ κΈ°λ₯ μ λλ©μ΄μ
(νμ₯ μλ κ°μ)
|
1293 |
const animateFireColumn = () => {
|
1294 |
+
fireColumn.scale.y += 0.05; // 0.1μμ 0.05λ‘ κ°μ
|
1295 |
fireColumn.children.forEach(fire => {
|
1296 |
fire.material.opacity *= 0.95;
|
1297 |
});
|
|
|
1304 |
};
|
1305 |
animateFireColumn();
|
1306 |
|
1307 |
+
// νλ° μ¬μ΄λ ν¨κ³Ό
|
1308 |
const explosionSounds = [
|
1309 |
new Audio('sounds/explosion.ogg'),
|
1310 |
new Audio('sounds/bang.ogg')
|
|
|
1314 |
sound.play();
|
1315 |
});
|
1316 |
|
1317 |
+
// μΉ΄λ©λΌ νλ€λ¦Ό ν¨κ³Ό (κ°λ κ°μ)
|
1318 |
if (window.gameInstance && window.gameInstance.camera) {
|
1319 |
const camera = window.gameInstance.camera;
|
1320 |
const originalPosition = camera.position.clone();
|
1321 |
let shakeTime = 0;
|
1322 |
+
const shakeIntensity = 0.5; // 1.0μμ 0.5λ‘ κ°μ
|
1323 |
+
const shakeDuration = 500; // 1000μμ 500μΌλ‘ κ°μ
|
1324 |
|
1325 |
const shakeCamera = () => {
|
1326 |
if (shakeTime < shakeDuration) {
|
|
|
1340 |
// μ€μ¬ νλμ μ κ±°
|
1341 |
setTimeout(() => {
|
1342 |
this.scene.remove(flash);
|
1343 |
+
}, 100); // 200μμ 100μΌλ‘ κ°μ
|
1344 |
}
|
1345 |
|
1346 |
|