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

Function seqTwoRandom

js/script.js:931–949  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

929}
930
931function seqTwoRandom() {
932 const size1 = getRandomShellSize();
933 const size2 = getRandomShellSize();
934 const shell1 = new Shell(shellFromConfig(size1.size));
935 const shell2 = new Shell(shellFromConfig(size2.size));
936 const leftOffset = Math.random() * 0.2 - 0.1;
937 const rightOffset = Math.random() * 0.2 - 0.1;
938 shell1.launch(0.3 + leftOffset, size1.height);
939 setTimeout(() => {
940 shell2.launch(0.7 + rightOffset, size2.height);
941 }, 100);
942
943 let extraDelay = Math.max(shell1.starLife, shell2.starLife);
944 if (shell1.fallingLeaves || shell2.fallingLeaves) {
945 extraDelay = 4600;
946 }
947
948 return 900 + Math.random() * 600 + extraDelay;
949}
950
951function seqTriple() {
952 const shellType = randomFastShell();

Callers 1

startSequenceFunction · 0.85

Calls 3

launchMethod · 0.95
getRandomShellSizeFunction · 0.85
shellFromConfigFunction · 0.85

Tested by

no test coverage detected