1asset cave_spider "Cave spider" complexity=4
2// a round, cute cave spider: a big striped abdomen with a fuzzy crest, a small head with two huge
3// eyes, two little eye-beads above them and two stubby fangs, eight knobbly legs splayed in a fan.
4// It breathes and taps a leg at rest; on scurry its legs ripple and it bobs along.
5let S = .9..1.1
6let bodyC = grape:2|plum:2|navy|cobalt|teal
7let markC = bubblegum:2|lilac|lime|marigold
8let legC = bodyC*.8
9
10// abdomen and head
11ball abdomen at=(0, .22*S, -.16*S) r=(.25, .22, .27)*S color=bodyC bands=[.5:markC .6:bodyC .72:markC .8:bodyC] segs=24 rings=16 joint
12puff tuft x3 on=abdomen at=(0, .2*S, .08) row=(0, -.04, -.1)*S r=(.05, .05, .045)*S color=bodyC*1.15 segs=8 rings=5
13ball head on=abdomen at=(0, -.04*S, .3*S) r=(.16, .14, .14)*S color=bodyC segs=18 rings=12 joint
14face look on=head eyes=round mouth=smile:2|fang|open size=.36 spacing=28 eyeY=12 mouthY=-30 mouthW=.3 iris=markC detail=.6
15ball bead on=head surf=(16, 52) mirror lift=-.01 r=.026*S color=inkDark ink=none segs=6 rings=4
16cone fang on=head at=(.04, -.11, .1)*S mirror rot=(180, 0, 0) h=.06*S r=.02*S color=cream segs=6
17
18// eight legs: an upper bone up and out, a lower bone down to a little foot
19limb leg x4 on=abdomen at=(.14*S, -.06*S, .26*S) mirror row=(0, 0, -.15*S) rot=(0, 45-i*30, 118) len=.24*S r=(.035, .03)*S color=legC segs=6 joint
20ball knee on=leg at=end r=.04*S color=legC segs=8 rings=5
21limb shin on=leg at=end rot=(0, 0, -92) len=.27*S r=(.03, .022)*S bands=[.8:markC] color=legC segs=6
22
23// idle: breathe, a tapping leg; scurry: rippling legs and a bob
24anim abdomen breathe amp=.04 hz=.6
25anim head ry sin amp=10 hz=.3
26anim leg rz sin amp=4 hz=.8 stagger=.25
27anim scurry: leg rx sin amp=24 hz=4 stagger=.25 twin=.5
28anim scurry: abdomen py bounce amp=.025 hz=8
29