skia2/resources/particles/orientation.json
Brian Osman c81378624f Update all example particle data to new single-code-chunk format
Change-Id: Ic53dc7ecab1b44761fe06e6b528864d24cc5fa58
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/363940
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-02 18:07:53 +00:00

31 lines
726 B
JSON

{
"MaxCount": 32,
"Drawable": {
"Type": "SkImageDrawable",
"Path": "images",
"Name": "index8.png",
"Columns": 1,
"Rows": 1
},
"Code": [
"void effectSpawn(inout Effect effect) {",
" effect.rate = 0.5;",
" effect.scale = 0.1;",
"}",
"",
"void spawn(inout Particle p) {",
" p.lifetime = 5;",
" float a = radians(mix(-30, -80, rand(p.seed)));",
" float s = mix(150, 200, rand(p.seed));",
" p.vel.x = cos(a) * s;",
" p.vel.y = sin(a) * s;",
"}",
"",
"void update(inout Particle p) {",
" p.vel.y += 50 * dt;",
" p.dir = normalize(p.vel);",
"}",
""
],
"Bindings": []
}