MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / addSpark

Function addSpark

assets/js/block_ninja.js:1155–1168  ·  view source on GitHub ↗
(x, y, xD, yD)

Source from the content-addressed store, hash-verified

1153
1154
1155function addSpark(x, y, xD, yD) {
1156 const spark = sparkPool.pop() || {};
1157
1158 spark.x = x + xD * 0.5;
1159 spark.y = y + yD * 0.5;
1160 spark.xD = xD;
1161 spark.yD = yD;
1162 spark.life = random(200, 300);
1163 spark.maxLife = spark.life;
1164
1165 sparks.push(spark);
1166
1167 return spark;
1168}
1169
1170
1171// Spherical spark burst

Callers 2

sparkBurstFunction · 0.85
glueShedSparksFunction · 0.85

Calls 1

randomFunction · 0.70

Tested by

no test coverage detected