(x, y, xD, yD)
| 1153 | |
| 1154 | |
| 1155 | function 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 |
no test coverage detected