blob: 09c76d264fede0bbeb408f50e4d04510e4ae7f14 [file] [log] [blame]
Brian Osman7c979f52019-02-12 13:27:51 -05001{
2 "MaxCount": 32,
Brian Osman543d2e22019-02-15 14:29:38 -05003 "Drawable": {
4 "Type": "SkImageDrawable",
Brian Osmand12f2782019-11-27 10:34:18 -05005 "Path": "images",
6 "Name": "explosion_sprites.png",
Brian Osman543d2e22019-02-15 14:29:38 -05007 "Columns": 4,
8 "Rows": 4
Brian Osman7c979f52019-02-12 13:27:51 -05009 },
Brian Osmand46cb972019-09-12 16:25:52 -040010 "EffectCode": [
11 "void effectSpawn(inout Effect effect) {",
12 " effect.rate = 8;",
13 "}",
Brian Osmand46cb972019-09-12 16:25:52 -040014 ""
15 ],
16 "Code": [
Brian Osman95c26ef2020-02-10 13:45:22 -050017 "float2 circle(inout uint seed) {",
Brian Osmand6108ad2019-07-25 16:27:35 -040018 " float x;",
19 " float y;",
20 " do {",
Brian Osman95c26ef2020-02-10 13:45:22 -050021 " x = rand(seed) * 2 - 1;",
22 " y = rand(seed) * 2 - 1;",
Brian Osmand6108ad2019-07-25 16:27:35 -040023 " } while (x*x + y*y > 1);",
24 " return float2(x, y);",
25 "}",
26 "",
Brian Osmane59acb72019-07-25 16:58:46 -040027 "void spawn(inout Particle p) {",
Brian Osman95c26ef2020-02-10 13:45:22 -050028 " p.lifetime = 1.0 + rand(p.seed) * 2.0;",
29 " float2 ofs = circle(p.seed) * 60;",
Brian Osmandf182962019-10-15 10:27:59 -040030 " p.pos += ofs;",
31 " p.vel = ofs / 3;",
Brian Osmand6108ad2019-07-25 16:27:35 -040032 "}",
Brian Osmand6108ad2019-07-25 16:27:35 -040033 "",
Brian Osmane59acb72019-07-25 16:58:46 -040034 "void update(inout Particle p) {",
Brian Osmand6108ad2019-07-25 16:27:35 -040035 " p.frame = p.age;",
36 "}",
37 ""
38 ],
Brian Osmanfe491632019-07-25 15:14:50 -040039 "Bindings": []
Brian Osman7c979f52019-02-12 13:27:51 -050040}