Glowfin · celworld
seed

Glowfin

glowfin v1Made by APIc4
Open in Playground

v1 cost

$0.193

API, priced from the call usage.

Time
70s
The run, with the maths
All 1 version$0.193

Budget

c4 · 49 lines
Shapes20 / 70
Triangles3,916 / 6,000
Draw calls4 / 4
States
idle · glow
Used in
No scene yet
Made
1asset glowfin "Glowfin" complexity=4 float
2// a chibi lantern-fish floater: a fat round body with big eyes, a dark back band and a pale belly,
3// fan fins on both sides, a fan tail and a dorsal sail, glowing photophore dots along the flanks,
4// and a curled stalk carrying a glowing bulb lure out in front of its face.
5// colourways: deep sea (cobalt), reef (coral), and a rare shiny (lilac with a mint lure)
6let S = .92..1.08
7let roll = 0..1
8let k = min(floor(roll*2.2), 2)
9let bodyC = sel(k, cobalt, coral, lilac)
10let backC = sel(k, navy, cherry, grape)
11let bellyC = sel(k, cream, peach, white)
12let finC = sel(k, aqua, sunflower, bubblegum)
13let rimC = sel(k, sky, marigold, pink)
14let lureC = sel(k, glow, glow, mint)
15let spotC = sel(k, lemon, lemon, aqua)
16
17// body: the root bone, floating
18ball body at=(0, .42*S, 0) r=(.22, .2, .24)*S color=bodyC under=bellyC bands=[.78:backC] segs=24 rings=16 joint
19face look on=body eyes=round mouth=smile size=.27 spacing=28 eyeY=8 mouthY=-24 mouthW=.3 detail=.7
20torus gill on=body surf=(58, -2) mirror lift=-.008*S R=.08*S r=.014*S arc=120 color=backC segs=10 sides=5
21
22// fins: fan pectorals, a fan tail, a dorsal sail, little belly fins
23slab fin on=body at=(.19, -.03, .02)*S mirror yaw=40 roll=-10 pts=[0,-.03 .13,.11 .19,.05 .2,-.02 .17,-.09 0,.03] t=.035*S round=.015*S scale=S color=finC edge=rimC joint
24ball tailbase on=body at=(0, 0, -.21)*S r=(.07, .09, .09)*S color=bodyC segs=12 rings=8 joint
25slab tail on=tailbase at=(0, 0, -.04*S) yaw=90 pts=[0,-.05 0,.05 .16,.16 .21,.07 .17,0 .21,-.07 .16,-.16] t=.035*S round=.015*S scale=S color=finC edge=rimC
26slab dorsal on=body at=(0, .16, -.02)*S yaw=90 pts=[-.06,0 .13,0 .15,.06 .06,.13 -.03,.1] t=.03*S round=.013*S scale=S color=finC edge=rimC
27slab pelvic on=body at=(.09, -.16, .02)*S mirror yaw=60 roll=-30 pts=[0,0 .1,-.05 .11,-.1 .02,-.04] t=.028*S round=.012*S scale=S color=finC
28
29// the lure: a curled stalk and a glowing bulb
30tube stalk on=body at=(0, .17, .05)*S pts=[0,0,0 0,.12,.02 0,.2,.1 0,.19,.2] r=(.026, .018)*S smooth sides=8 detail=.7 color=backC joint
31cone collar on=stalk at=end+(0, .02*S, 0) rot=(180, 0, 0) h=.05*S r=.04*S r2=.016*S color=finC segs=10
32ball lure on=stalk at=end+(0, -.06*S, 0) r=.072*S color=lureC ink=glow segs=16 rings=12 joint
33
34// photophores: glowing dots along each flank
35ball spot x3 on=body surf=(75+i*28, -18) mirror lift=-.012*S r=.026*S color=spotC ink=glow segs=8 rings=5
36
37// glow state: sparkles round the bulb
38fx glow: sparkle on=lure n=8 spread=.16 size=.025
39
40// idle: float and flutter
41anim idle: body bob amp=.04 hz=.6
42anim idle: fin flap amp=30 hz=3
43anim idle: tailbase wag amp=22 hz=1.4
44anim idle: stalk sway amp=6 hz=.5
45// glow: the bulb pulses, the stalk dips to show it off
46anim glow: lure s sin amp=.25 hz=1.2
47anim glow: stalk rx keys=[0:0 .5:12 1:0] hz=.6
48anim glow: fin flap amp=18 hz=2
49anim glow: body bob amp=.025 hz=.6
50