2019-09-12 20:25:52 +00:00
|
|
|
{
|
|
|
|
"MaxCount": 1000,
|
|
|
|
"Drawable": {
|
|
|
|
"Type": "SkCircleDrawable",
|
2019-09-25 15:24:50 +00:00
|
|
|
"Radius": 1
|
2019-09-12 20:25:52 +00:00
|
|
|
},
|
|
|
|
"EffectCode": [
|
|
|
|
"void effectSpawn(inout Effect effect) {",
|
2019-09-25 15:24:50 +00:00
|
|
|
" effect.lifetime = 2;",
|
|
|
|
" effect.rate = 120;",
|
2020-02-10 18:45:22 +00:00
|
|
|
" float a = radians(mix(-20, 20, rand(effect.seed)) - 90);",
|
|
|
|
" float s = mix(200, 220, rand(effect.seed));",
|
2019-09-25 15:24:50 +00:00
|
|
|
" effect.vel.x = cos(a) * s;",
|
|
|
|
" effect.vel.y = sin(a) * s;",
|
2020-02-10 18:45:22 +00:00
|
|
|
" effect.color.rgb = float3(rand(effect.seed), rand(effect.seed), rand(effect.seed));",
|
2019-09-25 15:24:50 +00:00
|
|
|
" effect.pos.x = 0;",
|
|
|
|
" effect.pos.y = 0;",
|
2019-09-12 20:25:52 +00:00
|
|
|
"}",
|
|
|
|
"",
|
|
|
|
"void effectUpdate(inout Effect effect) {",
|
2019-09-25 15:24:50 +00:00
|
|
|
" effect.vel.y += dt * 90;",
|
|
|
|
"}",
|
|
|
|
"",
|
|
|
|
"void effectDeath(inout Effect effect) {",
|
|
|
|
" explode(false);",
|
2019-09-12 20:25:52 +00:00
|
|
|
"}",
|
|
|
|
""
|
|
|
|
],
|
|
|
|
"Code": [
|
|
|
|
"void spawn(inout Particle p) {",
|
2019-09-25 15:24:50 +00:00
|
|
|
" p.lifetime = 0.5;",
|
2020-02-10 18:45:22 +00:00
|
|
|
" float a = radians(rand(p.seed) * 360);",
|
|
|
|
" float s = mix(5, 10, rand(p.seed));",
|
2019-09-12 20:25:52 +00:00
|
|
|
" p.vel.x = cos(a) * s;",
|
|
|
|
" p.vel.y = sin(a) * s;",
|
|
|
|
"}",
|
|
|
|
"",
|
|
|
|
"void update(inout Particle p) {",
|
|
|
|
" p.color.a = 1 - p.age;",
|
|
|
|
"}",
|
|
|
|
""
|
|
|
|
],
|
2019-09-25 15:24:50 +00:00
|
|
|
"Bindings": [
|
|
|
|
{
|
|
|
|
"Type": "SkEffectBinding",
|
|
|
|
"Name": "explode",
|
|
|
|
"MaxCount": 50,
|
|
|
|
"Drawable": {
|
|
|
|
"Type": "SkCircleDrawable",
|
|
|
|
"Radius": 3
|
|
|
|
},
|
|
|
|
"EffectCode": [
|
|
|
|
"void effectSpawn(inout Effect effect) {",
|
|
|
|
" effect.burst = 50;",
|
|
|
|
" effect.lifetime = 2.5;",
|
|
|
|
"}",
|
|
|
|
""
|
|
|
|
],
|
|
|
|
"Code": [
|
|
|
|
"void spawn(inout Particle p) {",
|
2020-02-10 18:45:22 +00:00
|
|
|
" p.lifetime = 2 + rand(p.seed) * 0.5;",
|
|
|
|
" float a = radians(rand(p.seed) * 360);",
|
|
|
|
" float s = mix(90, 100, rand(p.seed));",
|
2019-09-25 15:24:50 +00:00
|
|
|
" p.vel.x = cos(a) * s;",
|
|
|
|
" p.vel.y = sin(a) * s;",
|
|
|
|
"}",
|
|
|
|
"",
|
|
|
|
"void update(inout Particle p) {",
|
|
|
|
" p.color.a = 1 - p.age;",
|
|
|
|
" p.vel.y += dt * 50;",
|
|
|
|
"}",
|
|
|
|
""
|
|
|
|
],
|
|
|
|
"Bindings": []
|
|
|
|
}
|
|
|
|
]
|
2019-09-12 20:25:52 +00:00
|
|
|
}
|