Cinderbat · celworld
seed

Cinderbat

cinderbat v1Made by APIc4
Open in Playground

v1 cost

$0.198

API, priced from the call usage.

Time
69s
The run, with the maths
All 1 version$0.198

Budget

c4 · 46 lines
Shapes24 / 70
Triangles4,028 / 6,000
Draw calls4 / 4
States
idle · swoop
Used in
Made
1asset cinderbat "Cinderbat" complexity=4 float
2// an ember bat critter: a round furry ball of a body with a big-eyed face, tall pointed ears,
3// a little flame tuft on top, two stubby fangs, tucked feet and huge scalloped leathery wings
4// whose trailing edges glow like coals. Three colourways: ember (tangerine), soot (plum), and a
5// rare shiny (mint with aqua glow). It hovers; idle = gentle bob + lazy flaps, swoop = hard flaps + roll.
6let S = .92..1.08
7let WS = .95..1.15
8let shiny = chance(.1)
9let base = int(0..1)
10let cw = sel(shiny, base, 2)
11let bodyC = sel(cw, tangerine, plum, mint)
12let bellyC = sel(cw, cream, peach, white)
13let wingC = sel(cw, cherry, walnut, lilac)
14let boneC = sel(cw, redwood, inkDark, grape)
15let emberC = sel(cw, sunflower, tangerine, aqua)
16
17// body: the root bone, a big round ball that is head and body in one
18ball body at=(0, .42*S, 0) r=(.21, .2, .19)*S color=bodyC~ under=bellyC segs=24 rings=16 joint
19
20// ears, flame tuft, fangs
21cone ear on=body surf=(32, 50) lift=-.03*S mirror h=.17*S r=.07*S r2=.012*S depth=.6 color=body.color segs=10
22cone inner on=ear at=(0, .012*S, .022*S) h=.12*S r=.045*S r2=.008*S depth=.4 color=wingC segs=8
23cone tuft x3 on=body ring=10 ring0=90 at=(.035*S, .17*S, 0) roll=-22 h=.11*S r=.035*S r2=.006*S color=emberC ink=glow segs=8
24cone fang on=body surf=(10, -28) upright lift=-.012*S mirror rot=(180, 0, 0) h=.045*S r=.02*S color=white segs=6
25face look on=body eyes=round mouth=smile size=.27 spacing=27 eyeY=10 mouthY=-22 mouthW=.3 iris=emberC detail=.7
26
27// little tucked feet and a pointed tail nub
28ball foot on=body surf=(25, -72) upright lift=-.02*S mirror r=(.045, .035, .055)*S color=boneC segs=8 rings=5
29cone tailp on=body surf=(180, -35) lift=-.02*S h=.12*S r=.045*S r2=.008*S color=body.color segs=8
30
31// wings: a shoulder bone each, a scalloped membrane, a bony top spar, a glowing trailing edge
32ball shoulder on=body at=(.18, .04, -.04)*S mirror r=.06*S color=body.color segs=10 rings=6 joint
33slab membrane on=shoulder at=(.02, 0, 0) yaw=-15 scale=WS pts=[0,.06 .2,.16 .42,.21 .52,.06 .41,-.08 .31,-.02 .21,-.13 .11,-.05 0,-.07] t=.03 round=.012 color=wingC
34tube spar on=membrane pts=[0,.06,0 .2,.16,0 .42,.21,0 .52,.06,0] r=(.032, .02) smooth sides=6 detail=.6 color=boneC
35tube rim on=membrane pts=[.52,.06,0 .41,-.08,0 .31,-.02,0 .21,-.13,0 .11,-.05,0 0,-.07,0] r=.022 sides=6 detail=.6 color=emberC ink=glow
36cone claw on=membrane at=(.42, .2, 0) rot=(0, 0, 15) h=.07 r=.022 r2=.004 color=boneC segs=6
37
38// swoop leaves a trail of glowing embers off the tail
39fx swoop: puff on=tailp at=end n=5 hz=.9 speed=.3 gravity=-.3 size=.03 grow=1.6 color=emberC color2=tangerine ink=glow
40
41// idle: a hover bob with lazy wingbeats; swoop: hard flaps, a banking roll and a forward dip
42anim idle: body bob amp=.05 hz=.8
43anim idle: shoulder flap amp=22 hz=1.6
44anim swoop: shoulder flap amp=50 hz=3.2
45anim swoop: body rz sin amp=20 hz=.6
46anim swoop: body rx keys=[0:0 .5:18 1:0] hz=.6
47