Pebblo, the pebble golem toddler · celworld
seed

Pebblo, the pebble golem toddler

pebblo v1Made by APIc4
Open in Playground

v1 cost

$0.303

API, priced from the call usage.

Time
75s
The run, with the maths
All 1 version$0.303

Budget

c4 · 55 lines
Shapes26 / 70
Triangles5,042 / 6,000
Draw calls3 / 4
States
idle · stomp
Made
1asset pebblo "Pebblo, the pebble golem toddler" complexity=4
2// a pebble golem toddler: a round stone belly on two stubby stone feet, a big round stone head
3// with huge eyes, a soft moss cap topped by a tiny sprout flower, and stone mitt arms.
4// Readable from 20 m: the stacked round stones and the moss cap with its flower.
5// Three colourways: river grey with moss, warm sandstone with leafy moss, and a rare lilac 'shiny'.
6// The only states are idle (sway) and stomp (hard bob, a dust puff at each foot).
7let S = .95..1.1
8let shiny = chance(.08)
9let warm = chance(.45)
10let rockC = sel(shiny, sel(warm, rockCool, sandstone), lilac)
11let rock2 = sel(shiny, sel(warm, rockGrey, warmstone), bubblegum)
12let mossC = sel(shiny, sel(warm, moss, leafB), aqua)
13let pop = sel(shiny, sel(warm, tangerine, cherry), sunflower)
14let eyeC = sel(shiny, navy:2|plum, grape)
15
16// feet: two stubby stones, standing on the ground
17ball foot at=(.1*S, .068*S, .02*S) mirror r=(.095, .07, .11)*S color=rock2 segs=12 rings=8 joint
18
19// body: the round belly stone, the root of the upper stack
20ball body at=(0, .24*S, 0) r=(.21, .18, .19)*S color=rockC~ segs=20 rings=12 joint
21ball belly on=body surf=(0, -5) upright lift=-.05*S r=(.12, .11, .08)*S color=light(rockC, .08) segs=14 rings=8
22ball pebble on=body surf=(120, 25) mirror upright lift=-.02*S r=.05*S color=rock2 segs=8 rings=5
23ball backstone on=body surf=(180, -10) upright lift=-.02*S r=.055*S color=rock2 segs=8 rings=5
24
25// arms: short stone stubs with round mitts
26limb arm on=body at=(.17*S, .04*S, 0) mirror roll=25 len=.12*S r=(.06, .065)*S color=rockC segs=10 joint
27ball fist on=arm at=end r=.075*S color=rock2 segs=12 rings=8
28
29// head: the big round stone with big eyes
30ball head on=body at=(0, .26*S, .02*S) r=(.22, .19, .2)*S color=rockC segs=24 rings=14 joint
31face look on=head eyes=round mouth=smile size=.28 spacing=26 eyeY=4 mouthY=-28 mouthW=.3 iris=eyeC detail=.6
32
33// moss cap with drapey tufts
34puff cap on=head at=(0, .14*S, -.01*S) r=(.19, .09, .18)*S color=mossC segs=18 rings=10
35puff tuft x4 on=head ring ring0=45 surf=(0, 38) upright lift=-.04*S r=(.08, .06, .08)*S color=mossC segs=10 rings=6
36
37// the sprout flower on top
38rod sprout on=cap at=top+(0, -.02*S, 0) to=(0, .09*S, 0) r=.014*S sides=6 color=mossC*.8 joint
39slab leaflet on=sprout at=(.01*S, .04*S, 0) mirror roll=20 scale=S pts=[0,0 .07,.03 .09,0 .05,-.02] t=.02 color=mossC
40ball bud on=sprout at=end r=.03*S color=cream segs=8 rings=5
41ball petal x4 on=bud ring at=(.035*S, 0, 0) r=(.03, .02, .03)*S color=pop segs=6 rings=4
42
43// fx: dust puffs kicked up where the feet slam down
44fx stomp: puff on=foot at=bottom hz=1.6 speed=.6 spread=65 size=.045 grow=2 n=5 color=cream color2=rockSand
45
46// idle: a toddler sway, a little nod, arms swinging, the sprout wagging
47anim idle: body sway amp=5
48anim idle: head nod amp=4 hz=.4
49anim idle: arm rz sin amp=8 hz=.35
50anim idle: sprout wag amp=15 hz=.8
51// stomp: the feet lift and slam in turn, the body drops hard on every landing
52anim stomp: foot py keys=[0:0 .25:.07 .45:0 1:0] hz=1.6 twin=.5
53anim stomp: body py keys=[0:0 .5:.02 .9:-.045 1:0] hz=3.2
54anim stomp: arm rx keys=[0:0 .3:-25 .5:10 1:0] hz=1.6 twin=.5
55anim stomp: sprout rx keys=[0:0 .5:-10 .9:18 1:0] hz=3.2
56