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

Function ghostShell

js/script.js:614–633  ·  view source on GitHub ↗
(size = 1)

Source from the content-addressed store, hash-verified

612};
613
614const ghostShell = (size = 1) => {
615 // Extend crysanthemum shell
616 const shell = crysanthemumShell(size);
617 // Ghost effect can be fast, so extend star life
618 shell.starLife *= 1.5;
619 // Ensure we always have a single color other than white
620 let ghostColor = randomColor({ notColor: COLOR.White });
621 // Always use streamers, and sometimes a pistil
622 shell.streamers = true;
623 const pistil = Math.random() < 0.42;
624 const pistilColor = pistil && makePistilColor(ghostColor);
625 // Ghost effect - transition from invisible to chosen color
626 shell.color = INVISIBLE;
627 shell.secondColor = ghostColor;
628 // We don't want glitter to be spewed by invisible stars, and we don't currently
629 // have a way to transition glitter state. So we'll disable it.
630 shell.glitter = "";
631
632 return shell;
633};
634
635const strobeShell = (size = 1) => {
636 const color = randomColor({ limitWhite: true });

Callers

nothing calls this directly

Calls 3

crysanthemumShellFunction · 0.85
randomColorFunction · 0.85
makePistilColorFunction · 0.85

Tested by

no test coverage detected