Thornhog · celworld
seed

Thornhog

thornhog v1Made by APIc4
Open in Playground

v1 cost

$0.152

API, priced from the call usage.

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

Budget

c4 · 50 lines
Shapes35 / 70
Triangles4,892 / 6,000
Draw calls3 / 4
States
idle · curl
Used in
No scene yet
Made
1asset thornhog "Thornhog" complexity=4
2// a chibi bramble hedgehog: a round mantle body on four stubby legs, a big pale face with
3// huge eyes, a pointed snout tipped with a fat berry nose, and rows of curved rose-thorn spikes
4// whose tips blush rose, with two little roses tucked in the bramble. Idle: sniff. Curl: tuck and roll.
5let S = .92..1.08
6let SP = .9..1.15
7// colourways: 0 bramble green, 1 autumn oak, 2 rare shiny lilac/gold
8let SHN = chance(.08)
9let CW = (1-SHN)*int(0..1) + SHN*2
10let mantleC = sel(CW, leafB, oak, lilac)
11let thornC = sel(CW, leafDark, walnut, sky)
12let tipC = sel(CW, flowerRed, blossomPink, sunflower)
13let skinC = sel(CW, peach, cream, white)
14let noseC = sel(CW, berryBlue, berryRed, grape)
15let roseC = sel(CW, flowerPink, flowerRed, sunflower)
16let irisC = sel(CW, navy, walnut, grape)
17
18// body: the root bone on four stubby legs
19ball body at=(0, .23*S, 0) r=(.21, .19, .23)*S color=mantleC under=skinC segs=20 rings=12 joint
20limb leg x2 on=body row=(0, 0, .2*S) at=(.11*S, -.11*S, 0) mirror len=.09*S r=(.05, .045)*S bands=[.65:thornC] color=skinC segs=8 joint
21ball tail on=body surf=(180, -5) lift=-.02*S r=.04*S color=mantleC segs=8 rings=5
22
23// head: big and pale, with a mantle hood behind the face
24ball head on=body at=(0, .05*S, .17*S) r=(.165, .15, .15)*S color=skinC segs=20 rings=12 joint
25ball hood on=head surf=(180, 35) upright lift=-.1*S r=(.16, .14, .13)*S color=mantleC segs=14 rings=8
26cone snout on=head surf=(0, -14) lift=-.03*S h=.09*S r=.058*S r2=.026*S color=skinC segs=10 joint
27ball nose on=snout at=end r=.034*S color=noseC ink=thin segs=10 rings=6 joint
28ball ear on=head surf=(58, 42) mirror lift=-.015*S r=(.042, .046, .022)*S color=skinC segs=8 rings=5
29face look on=head eyes=round mouth=smile size=.25 spacing=29 eyeY=10 mouthY=-34 mouthW=.28 iris=irisC blush detail=.6
30
31// rose-thorn spikes: three rows over the back, curved, tips blushing rose
32cone spikeA x7 on=body surf=(90+i*30, 10) lift=-.025*S h=.11*S*SP r=.042*S bend=18 bands=[.55:tipC] color=thornC segs=7
33cone spikeB x6 on=body surf=(105+i*30, 40) lift=-.025*S h=.12*S*SP r=.044*S bend=18 bands=[.55:tipC] color=thornC segs=7
34cone spikeC x3 on=body surf=(140+i*40, 70) lift=-.025*S h=.12*S*SP r=.044*S bend=18 bands=[.55:tipC] color=thornC segs=7
35cone crest x3 on=hood surf=(140+i*40, 55) lift=-.02*S h=.09*S*SP r=.036*S bend=18 bands=[.55:tipC] color=thornC segs=7
36
37// little roses tucked in the bramble
38ball rose on=body surf=(150, 55) mirror lift=-.01*S r=.045*S color=roseC ink=thin segs=10 rings=6
39ball bud on=body surf=(180, 28) lift=-.01*S r=.036*S color=roseC ink=thin segs=8 rings=5 if=chance(.6)
40
41// idle: sniff sniff, a breathing body, a curious nod
42anim idle: snout rx keys=[0:0 .12:-9 .24:0 .36:-9 .48:0 1:0] hz=.8
43anim idle: nose s sin amp=.12 hz=3
44anim idle: head nod amp=5 hz=.45
45anim idle: body breathe
46// curl: tuck the head and legs, then roll over into a spiky ball and hold
47anim curl: head rx keys=[0:0 .4:45 1:50] hz=1 once
48anim curl: head pz keys=[0:0 .4:-.05 1:-.06] hz=1 once
49anim curl: leg s keys=[0:0 .4:-.6 1:-.65] hz=1 once
50anim curl: body rx keys=[0:0 .3:-10 .75:300 1:360] hz=.8 once
51