Mossnail · celworld
seed

Mossnail

mossnail v1Made by APIc4
Open in Playground

v1 cost

$0.152

API, priced from the call usage.

Time
62s
The run, with the maths
All 1 version$0.152

Budget

c4 · 49 lines
Shapes26 / 70
Triangles5,648 / 6,000
Draw calls3 / 4
States
idle · crawl
Used in
Made
1asset mossnail "Mossnail" complexity=4
2// a chibi moss snail: a soft squat foot, a big round head with huge eyes, two stubby
3// mushroom antennae, and a fat rounded spiral shell carpeted with moss puffs on top.
4// three colourways: meadow (peach and oak), dusk (lilac and terracotta) and a rare shiny (sky and gold with pink moss)
5let S = .92..1.08
6let eyeS = .22..0.27
7let cw = 0:5|1:5|2:1
8let bodyC = sel(cw, peach, lilac, sky)
9let soleC = sel(cw, cream, white, white)
10let shellC = sel(cw, oak, terracotta, sunflower)
11let coilC = sel(cw, cream, cream, white)
12let mossC = sel(cw, leafB, moss, blossomPink)
13let capC = sel(cw, cherry, marigold, bubblegum)
14let spotC = sel(cw, cream, white, white)
15
16// the foot: the root bone, a squat slug body with a pale sole
17ball body at=(0, .1*S, 0) scale=S r=(.18, .11, .34) color=bodyC under=soleC segs=22 rings=14 joint
18ball tail on=body at=(0, -.03, -.3) r=(.1, .065, .13) color=bodyC under=soleC segs=12 rings=8 joint
19ball nub x3 on=body row=(0, 0, .18) at=(.15, -.065, -.02) mirror r=(.05, .045, .065) color=bodyC*.9 segs=8 rings=5 joint
20
21// the big head, raised at the front of the foot
22ball head on=body at=(0, .17, .25) r=(.17, .16, .15) color=bodyC segs=20 rings=14 joint
23
24// the shell: a fat rounded disc on its side, a raised spiral on each face, moss on top
25cyl shell on=body at=(-.14, .24, -.1) rot=(0, 0, -90) h=.28 r=.22 round=.09 cap=shellC color=shellC segs=24
26tube coil on=body at=(.152, .24, -.1) mirror scale=.38 pts=[0,.42,.21 0,.26,.37 0,.05,.42 0,-.15,.37 0,-.29,.24 0,-.34,.08 0,-.32,-.09 0,-.22,-.21 0,-.09,-.27 0,.05,-.26 0,.15,-.19 0,.19,-.09 0,.19,.01 0,.14,.09 0,.07,.12 0,0,.12 0,-.04,.08] r=(.09, .06) smooth sides=6 detail=.5 color=coilC
27puff moss x3 on=body row=(0, 0, .12) at=(0, .435, -.1) r=(.11, .07, .085) color=mossC segs=10 rings=7
28
29// mushroom antennae: stubby stalks with spotted caps
30rod stalk on=head at=(.07, .11, 0) mirror to=(.05, .15, .02) r=(.028, .022) sides=8 color=bodyC joint
31ball mcap on=stalk at=end+(0, -.01, 0) half r=(.075, .055, .075) color=capC segs=12 rings=6
32ball dot on=mcap at=(0, .052, 0) r=(.022, .012, .022) color=spotC ink=thin segs=6 rings=4
33ball side on=mcap at=(.045, .03, .02) mirror r=(.018, .012, .018) color=spotC ink=thin segs=6 rings=4
34
35// the face: huge round eyes, a small smile; blush only on the warm colourways
36face look on=head if=cw<2 eyes=round mouth=smile size=eyeS spacing=27 eyeY=8 mouthY=-30 mouthW=.3 blush detail=.7
37face lookB on=head if=cw==2 eyes=round mouth=smile size=eyeS spacing=27 eyeY=8 mouthY=-30 mouthW=.3 detail=.7
38
39// idle: antennae sway, the head bobs a little, the body breathes
40anim idle: stalk rz sin amp=12 hz=.5 twin=.5
41anim idle: stalk rx sin amp=6 hz=.35
42anim idle: head nod amp=4 hz=.4
43anim idle: body breathe amp=.025 hz=.3
44// crawl: the foot stretches (head forward, tail back) then gathers, a ripple runs down the nubs
45anim crawl: head pz keys=[0:0 .5:.045 1:0] hz=1
46anim crawl: tail pz keys=[0:0 .5:-.035 1:0] hz=1
47anim crawl: body breathe amp=.03 hz=1
48anim crawl: nub py sin amp=.015 hz=2 stagger=.33
49anim crawl: stalk rx keys=[0:0 .5:-14 1:0] hz=1
50