Petalpuff · celworld
seed

Petalpuff

petalpuff v1Made by APIc4
Open in Playground

v1 cost

$0.200

API, priced from the call usage.

Time
76s
The run, with the maths
All 1 version$0.200

Budget

c4 · 51 lines
Shapes28 / 70
Triangles5,866 / 6,000
Draw calls3 / 4
States
idle · spin
Used in
Made
1asset petalpuff "Petalpuff" complexity=4
2// a round bloom blob: a plump flower-heart body with a big face, a double ruff of petals fanned
3// behind it like a sunflower, stubby legs on leaf feet, leaf hands and a sprout on top.
4// Three colourways: sunny cream/coral, lemon/sky, and a rare shiny white/grape with teal leaves.
5// States: idle (petals sway, body breathes) and spin (a hopping twirl with sparkles).
6let S = .92..1.08
7let cwRoll = 0..1
8let cw = min(2, floor(cwRoll*2.2))
9let bodyC = sel(cw, cream, lemon, white)
10let petalC = sel(cw, coral, sky, grape)
11let petal2C = sel(cw, peach, aqua, lilac)
12let leafCol = sel(cw, leafB, leafA, teal)
13let ruffN = int(9..11)
14
15// body: the bloom heart, root bone
16ball body at=(0, .35*S, 0) r=(.22, .21, .2)*S color=bodyC under=bodyC*.92 segs=22 rings=14 joint
17
18// the petal ruff: a hidden hub turned to face forward, two rings of petals fanned round it
19ball hub on=body at=(0, 0, -.08*S) rot=(90, 0, 0) r=(.15, .04, .15)*S color=petalC*.85 segs=12 rings=6
20limb petal x=ruffN on=hub ring ring0=0 at=(.12*S, 0, 0) rot=(0, 0, 90) scale=(.5, 1, 1) len=.14*S r=(.065, .075)*S color=petalC segs=8 joint
21limb inner x6 on=hub ring ring0=30 at=(.1*S, .025*S, 0) rot=(0, 0, 90) scale=(.5, 1, 1) len=.1*S r=(.055, .062)*S color=petal2C segs=8 joint
22
23// stubby legs on leaf feet
24limb leg on=body at=(.09*S, -.17*S, .05*S) mirror len=.12*S r=(.055, .05)*S color=leafCol segs=10 joint
25ball foot on=leg at=end+(0, -.025*S, .04*S) r=(.075, .035, .11)*S color=leafCol segs=10 rings=6
26
27// leaf hands
28ball hand on=body surf=(72, -18) lift=-.03*S mirror r=(.04, .085, .03)*S color=leafCol segs=10 rings=6 joint
29
30// a sprout on top
31cyl sprout on=body at=top-(0, .02*S, 0) h=.07*S r=.02*S color=leafCol segs=8
32ball sprig on=sprout at=(.04*S, .07*S, 0) roll=-55 mirror r=(.055, .022, .032)*S color=leafCol segs=8 rings=5
33
34// face: big readable eyes
35face look on=body eyes=round mouth=smile size=.32 spacing=26 eyeY=10 mouthY=-20 mouthW=.3 blush detail=.6
36
37// spin sparkles
38fx spin: sparkle on=body at=(0, .1*S, 0) spread=.4 n=8
39
40// idle: petals sway in a wave, breathing, little hand waves
41anim idle: petal rz sin amp=10 hz=.6 stagger=.1
42anim idle: inner rz sin amp=8 hz=.6 stagger=.15 phase=.3
43anim idle: body breathe
44anim idle: hand rz sin amp=12 hz=.5 twin=.5
45// spin: a hopping twirl, petals flared, arms out
46anim spin: body ry spin hz=1.2
47anim spin: body py bounce amp=.05 hz=2.4
48anim spin: petal rz sin amp=18 hz=2.4 stagger=.1
49anim spin: inner rz sin amp=14 hz=2.4 stagger=.1
50anim spin: hand rz keys=[0:0 .3:50 .7:50 1:0] hz=1.2
51anim spin: leg rx sin amp=15 hz=2.4 twin=.5
52