# pirt.js — runExplosionParticles() (satır 425) [← pirt.js](index.md) · [← Master](../../wiki.md) Parça 2/2 · [önceki](runExplosionParticles.md) ```javascript var py = cy + dyCurrent; // Particle density along the ring var particlesOnRing = Math.floor(currentRadius * 2.2); if (particlesOnRing < 8) particlesOnRing = 8; if (particlesOnRing > 60) particlesOnRing = 60; for (var p = 0; p < particlesOnRing; p++) { var angle = (p / particlesOnRing) * 2.0 * Math.PI; var rotAngle = angle + animTick * 0.08; var px = cx + currentRadius * Math.cos(rotAngle); var pz = cz + currentRadius * Math.sin(rotAngle); // Spawn black smoke with dark purple portal magical sparkles and falling black dust var rand = Math.random(); if (rand < 0.50) { spawnSpellParticle(world, p1, px, py, pz, 1, 0, 0, 0, 0); } else if (rand < 0.80) { spawnSpellParticle(world, p2, px, py, pz, 1, 0, 0, 0, 0); } else { spawnSpellParticle(world, p3, px, py, pz, 1, 0, 0, 0, 0); } } } if (animTick % 3 === 0) { world.playSound("minecraft:entity.illusion_illager.prepare_mirror", cx, cy, cz, 1.6, 0.7 + t * 0.5); } animTick++; c.setValue("explosionAnimTick", animTick); c.scheduleScript("runExplosionParticles", 1); } ```