MCPcopy Create free account
hub / github.com/NianBroken/Firework_Simulator / crackleEffect

Function crackleEffect

js/script.js:1638–1651  ·  view source on GitHub ↗
(star)

Source from the content-addressed store, hash-verified

1636// Crackle pops into a small cloud of golden sparks.
1637//噼里啪啦的一声,迸出一小团金色的火花。
1638function crackleEffect(star) {
1639 const count = isHighQuality ? 32 : 16;
1640 createParticleArc(0, PI_2, count, 1.8, (angle) => {
1641 Spark.add(
1642 star.x,
1643 star.y,
1644 COLOR.Gold,
1645 angle,
1646 // apply near cubic falloff to speed (places more particles towards outside)
1647 Math.pow(Math.random(), 0.45) * 2.4,
1648 300 + Math.random() * 200
1649 );
1650 });
1651}
1652
1653/**
1654 * 烟花可以用以下选项构建:

Callers 1

burstMethod · 0.85

Calls 1

createParticleArcFunction · 0.85

Tested by

no test coverage detected