• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2   "MaxCount": 32,
3   "Drawable": {
4      "Type": "SkImageDrawable",
5      "Path": "images",
6      "Name": "explosion_sprites.png",
7      "Columns": 4,
8      "Rows": 4
9   },
10   "Code": [
11      "void effectSpawn(inout Effect effect) {",
12      "  effect.rate = 8;",
13      "}",
14      "",
15      "float2 circle(inout float seed) {",
16      "  float r = sqrt(rand(seed));",
17      "  float a = rand(seed) * 6.283185;",
18      "  return r * float2(sin(a), cos(a));",
19      "}",
20      "",
21      "void spawn(inout Particle p) {",
22      "  p.lifetime = 1.0 + rand(p.seed) * 2.0;",
23      "  float2 ofs = circle(p.seed) * 60;",
24      "  p.pos += ofs;",
25      "  p.vel = ofs / 3;",
26      "}",
27      "",
28      "void update(inout Particle p) {",
29      "  p.frame = p.age;",
30      "}",
31      ""
32   ],
33   "Bindings": []
34}