Coral cub · celworld
seed

Coral cub

coralcub v1Made by APIc4
Open in Playground

v1 cost

$0.114

API, priced from the call usage.

Time
45s
The run, with the maths
All 1 version$0.114

Budget

c4 · 52 lines
Shapes30 / 70
Triangles4,658 / 6,000
Draw calls3 / 4
States
idle · wave
Used in
No scene yet
Made
1asset coralcub "Coral cub" complexity=4
2// a chibi bear cub grown from a reef: a round body on stubby legs, a big round head with
3// round ears, two branching coral horns with knobbly tips, and a seafoam belly. Big eyes.
4// Colourways: 0 classic coral, 1 sunset peach, 2 rare shiny lilac with golden coral.
5let S = .92..1.08
6let HS = .95..1.08
7let shiny = chance(.08)
8let alt = chance(.5)
9let cw = shiny*2 + (1-shiny)*alt
10let coatC = sel(cw, coral, peach, lilac)
11let bellyC = sel(cw, mint, aqua, foam)
12let hornC = sel(cw, tomato, bubblegum, sunflower)
13let tipC = sel(cw, pink, coral, white)
14let eyeC = sel(cw, navy, teal, grape)
15let hornL = .9..1.15
16
17// body: the root bone on two stubby legs
18ball body at=(0, .25*S, 0) r=(.17, .18, .155)*S color=coatC segs=20 rings=12 joint
19ball belly on=body surf=(0, -10) upright lift=-.08*S r=(.12, .13, .07)*S color=bellyC segs=12 rings=8
20limb leg on=body at=(.085*S, -.12*S, 0) mirror len=.075*S r=(.062, .06)*S color=coatC segs=10 joint
21ball pad on=leg at=end+(0, .02*S, .03*S) r=(.05, .03, .05)*S color=bellyC segs=8 rings=5
22ball tail on=body surf=(180, -15) upright lift=-.03*S r=.055*S color=bellyC segs=10 rings=6
23
24// head: big and round, a third of the height and more
25ball head on=body at=(0, .24*S, .02*S) r=(.2, .185, .18)*S*HS color=coatC segs=24 rings=14 joint
26ball ear on=head surf=(58, 38) lift=-.035*S mirror r=(.07, .07, .04)*S color=coatC segs=10 rings=6
27ball inner on=ear at=(0, 0, .02*S) r=(.042, .042, .03)*S color=bellyC segs=8 rings=5
28ball nose on=head surf=(0, -10) upright lift=-.01*S r=(.03, .022, .02)*S color=inkDark ink=thin segs=8 rings=5
29face look on=head eyes=round mouth=smile size=.27 spacing=30 eyeY=14 mouthY=-28 mouthW=.28 iris=eyeC blush detail=.6
30
31// branching coral horns: a trunk, two side branches, round knobbly tips
32cone horn on=head surf=(26, 62) lift=-.02*S mirror h=.15*S*hornL r=.036*S r2=.018*S color=hornC segs=8 joint
33cone twigA on=horn at=(0, .06*S*hornL, 0) roll=-50 h=.08*S r=.022*S r2=.012*S color=hornC segs=7
34cone twigB on=horn at=(0, .1*S*hornL, 0) roll=45 h=.065*S r=.02*S r2=.011*S color=hornC segs=7
35ball knob on=horn at=end r=.025*S color=tipC segs=8 rings=5
36ball knobA on=twigA at=end r=.018*S color=tipC segs=8 rings=5
37ball knobB on=twigB at=end r=.017*S color=tipC segs=8 rings=5
38
39// arms: written apart so the waving arm can move alone
40limb arm on=body at=(.15*S, .07*S, .02*S) roll=18 len=.09*S r=(.052, .046)*S color=coatC segs=10 joint
41ball paw on=arm at=end r=.045*S color=bellyC segs=8 rings=5
42limb armR on=body at=(-.15*S, .07*S, .02*S) roll=-18 len=.09*S r=(.052, .046)*S color=coatC segs=10 joint
43ball pawR on=armR at=end r=.045*S color=bellyC segs=8 rings=5
44
45// idle: slow breath, a gentle head nod and horn sway
46anim idle: body breathe amp=.04
47anim idle: head nod amp=4 hz=.4
48anim idle: horn rz sin amp=4 hz=.5 twin=.5
49// wave: the left arm swings up and waves, the head tilts to greet
50anim wave: arm rz keys=[0:18 .2:150 .35:120 .5:155 .65:120 .8:150 1:18] hz=.6
51anim wave: head rz keys=[0:0 .2:-8 .8:-8 1:0] hz=.6
52anim wave: body breathe amp=.03
53