2ae02492a7
This was unnecessary (closed-form unit-disc picking is simpler), and these loops don't meet the strict ES2 standards that we'll be applying to the interpreter soon. Bug: skia:11095 Change-Id: Ic2617c2807fe49d57ff8e4d57d70b9ed1f015916 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348895 Reviewed-by: Kevin Lubick <kjlubick@google.com> Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
36 lines
827 B
JSON
36 lines
827 B
JSON
{
|
|
"MaxCount": 32,
|
|
"Drawable": {
|
|
"Type": "SkImageDrawable",
|
|
"Path": "images",
|
|
"Name": "explosion_sprites.png",
|
|
"Columns": 4,
|
|
"Rows": 4
|
|
},
|
|
"EffectCode": [
|
|
"void effectSpawn(inout Effect effect) {",
|
|
" effect.rate = 8;",
|
|
"}",
|
|
""
|
|
],
|
|
"Code": [
|
|
"float2 circle(inout float seed) {",
|
|
" float r = sqrt(rand(seed));",
|
|
" float a = rand(seed) * 6.283185;",
|
|
" return r * float2(sin(a), cos(a));",
|
|
"}",
|
|
"",
|
|
"void spawn(inout Particle p) {",
|
|
" p.lifetime = 1.0 + rand(p.seed) * 2.0;",
|
|
" float2 ofs = circle(p.seed) * 60;",
|
|
" p.pos += ofs;",
|
|
" p.vel = ofs / 3;",
|
|
"}",
|
|
"",
|
|
"void update(inout Particle p) {",
|
|
" p.frame = p.age;",
|
|
"}",
|
|
""
|
|
],
|
|
"Bindings": []
|
|
} |