1asset dungeon_slime "Dungeon slime" complexity=3
2// a jelly slime: a fat glossy drop with a curled tip, sitting in its own little puddle, big eyes and
3// a grin, a glint on its shoulder. Some wear a victim's dented helmet, some have a coin stuck on top.
4// It wobbles at rest; on hop it squashes, springs up and lands with a splat.
5let S = .9..1.12
6let slimeC = lime:3|mint:2|aqua|bubblegum|grape:.5
7let helm = int(0..3)
8
9// the puddle and the body
10cyl puddle h=.03 r=.36*S color=slimeC*.82 segs=32
11lathe body at=(0, .015, 0) h=.52*S r=.32*S prof=[0:.86 .12:1 .45:.88 .78:.5 .92:.22 1:0] bend=12 color=slimeC segs=32 rings=20 joint
12ball drip x3 on=puddle ring ring0=20 at=(.3*S, .02, 0) r=(.07, .045, .07)*S color=slimeC segs=8 rings=5
13face look on=body eyes=round:3|dot mouth=grin:2|open|fang size=.34 spacing=30 eyeY=4 mouthY=-24 mouthW=.42 iris=inkDark detail=.6
14ball shine on=body at=(-.13, .3, .17)*S r=(.05, .07, .035)*S color=white ink=none segs=8 rings=5
15ball shine2 on=body at=(-.19, .2, .13)*S r=.025*S color=white ink=none segs=6 rings=4
16
17// a souvenir on top, by seed
18ball helmet on=body at=(.04, .33*S, -.03) rot=(0, 0, -18) r=(.17, .1, .17)*S half color=iron segs=14 rings=6 if=helm==0
19torus brim on=helmet at=(0, .004, 0) R=.17*S r=.018 color=iron*1.3 segs=16 sides=5
20cyl coin on=body at=(.06, .4*S, .03) rot=(70, 0, 10) h=.025 r=.07*S color=sunflower cap=marigold segs=12 if=helm==1
21
22// idle wobble; hop: squash, spring, splat
23anim body s sin amp=.05 hz=.9
24anim body rz sin amp=3 hz=.45
25anim hop: body py keys=[0:0 .15:-.04 .45:.32 .75:0 .85:-.03 1:0] hz=1.3
26anim hop: body s keys=[0:0 .15:.12 .45:-.06 .8:.14 1:0] hz=1.3
27