• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2   "MaxCount": 1000,
3   "Drawable": {
4      "Type": "SkCircleDrawable",
5      "Radius": 2
6   },
7   "Code": [
8      "void effectSpawn(inout Effect effect) {",
9      "  effect.rate = 200;",
10      "  effect.color = float4(1, 0, 0, 1);",
11      "}",
12      "",
13      "void spawn(inout Particle p) {",
14      "  p.lifetime = 3 + rand(p.seed);",
15      "  p.vel.y = -50;",
16      "}",
17      "",
18      "void update(inout Particle p) {",
19      "  float w = mix(15, 3, p.age);",
20      "  p.pos.x = sin(radians(p.age * 320)) * mix(25, 10, p.age) + mix(-w, w, rand(p.seed));",
21      "  if (rand(p.seed) < 0.5) { p.pos.x = -p.pos.x; }",
22      "",
23      "  p.color.g = (mix(75, 220, p.age) + mix(-30, 30, rand(p.seed))) / 255;",
24      "}",
25      ""
26   ],
27   "Bindings": []
28}