• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2   "MaxCount": 4096,
3   "Drawable": {
4      "Type": "SkCircleDrawable",
5      "Radius": 2
6   },
7   "Code": [
8      "void effectSpawn(inout Effect effect) {",
9      "  effect.rate = 90;",
10      "}",
11      "",
12      "float2 circle(inout float seed) {",
13      "  float r = sqrt(rand(seed));",
14      "  float a = rand(seed) * 6.283185;",
15      "  return r * float2(sin(a), cos(a));",
16      "}",
17      "",
18      "void spawn(inout Particle p) {",
19      "  p.lifetime = 30;",
20      "  p.pos += circle(p.seed) * 40;",
21      "}",
22      "",
23      "void update(inout Particle p) {",
24      "  p.vel += normalize(p.pos - effect.pos) * dt * 10;",
25      "  p.scale = mix(0.25, 3, p.age);",
26      "}",
27      ""
28   ],
29   "Bindings": []
30}