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;",
|
|
|
|
" float a = radians(mix(-20, 20, rand) - 90);",
|
|
|
|
" float s = mix(200, 220, rand);",
|
|
|
|
" effect.vel.x = cos(a) * s;",
|
|
|
|
" effect.vel.y = sin(a) * s;",
|
2019-09-12 20:25:52 +00:00
|
|
|
" effect.color.rgb = float3(rand, rand, rand);",
|
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;",
|
2019-09-12 20:25:52 +00:00
|
|
|
" float a = radians(rand * 360);",
|
2019-09-25 15:24:50 +00:00
|
|
|
" float s = mix(5, 10, rand);",
|
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) {",
|
|
|
|
" p.lifetime = 2 + rand * 0.5;",
|
|
|
|
" float a = radians(rand * 360);",
|
|
|
|
" float s = mix(90, 100, rand);",
|
|
|
|
" 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
|
|
|
}
|