Mistmoth · celworld
seed

Mistmoth

mistmoth v1Made by APIc4
Open in Playground

v1 cost

$0.196

API, priced from the call usage.

Time
66s
The run, with the maths
All 1 version$0.196

Budget

c4 · 56 lines
Shapes28 / 70
Triangles5,088 / 6,000
Draw calls4 / 4
States
idle · dust
Used in
No scene yet
Made
1asset mistmoth "Mistmoth" complexity=4 float
2// a fluffy chibi moth that hovers: a round fuzzy body with a puffy collar, a big head with huge eyes,
3// two feather antennae, and broad upper and lower wings marked with a crescent moon on each upper wing.
4// Three colourways: dawn (cream/lilac), dusk (lilac/sky) and a rare shiny (mint/sunflower).
5let S = .92..1.08
6let WS = .92..1.12
7let k = max(int(0..1), chance(.12)*2)
8let fluffC = sel(k, cream, lilac, mint)
9let trimC = sel(k, white, cream, white)
10let wingC = sel(k, lilac, sky, sunflower)
11let patC = sel(k, plum, navy, coral)
12let popC = sel(k, sunflower, peach, bubblegum)
13
14// body: the root bone, hovering a little off the ground
15ball body at=(0, .34*S, 0) r=(.2, .22, .19)*S color=fluffC under=trimC segs=20 rings=12 joint
16puff collar x6 on=body ring=10 at=(.15*S, .13*S, 0) r=(.075, .065, .075)*S color=trimC segs=8 rings=6
17ball tuft on=body at=(0, -.06*S, -.17*S) r=(.09, .08, .08)*S color=fluffC segs=10 rings=7
18
19// head: big and round, sunk into the collar
20ball head on=body at=(0, .27*S, .03*S) r=(.19, .18, .17)*S color=fluffC segs=20 rings=12 joint
21face look on=head eyes=round mouth=smile size=.3 spacing=27 eyeY=6 mouthY=-30 mouthW=.25 iris=patC blush detail=.7 if=k<2
22face lookS on=head eyes=round mouth=smile size=.3 spacing=27 eyeY=6 mouthY=-30 mouthW=.25 iris=patC detail=.7 if=k==2
23
24// feather antennae
25rod stalk on=head at=(.06*S, .14*S, .04*S) mirror to=(.06, .12, .03)*S r=.012*S sides=6 color=patC joint
26slab feather on=stalk at=end+(0, -.01*S, 0) roll=-18 scale=S pts=[0,0 .055,.06 .05,.16 0,.23 -.05,.16 -.055,.06] t=.025 round=.01 color=popC edge=patC
27
28// wings: broad upper wings with a crescent moon, small lower wings with a dot (scale carries S*WS to the markings)
29slab wing on=body at=(.12*S, .06*S, -.1*S) mirror yaw=22 roll=8 scale=S*WS pts=[0,-.04 .15,-.06 .32,0 .41,.14 .37,.29 .22,.33 .08,.21 0,.07] t=.04 round=.015 color=wingC edge=patC joint
30ball moon on=wing at=(.25, .15, 0) r=(.075, .075, .03) color=popC segs=10 rings=6
31ball shadow on=wing at=(.285, .175, 0) r=(.06, .065, .036) color=wingC segs=10 rings=6
32slab hindwing on=body at=(.1*S, -.06*S, -.11*S) mirror yaw=28 roll=-6 scale=S*WS pts=[0,.02 .1,-.1 .24,-.2 .3,-.13 .24,-.02 .1,.05] t=.035 round=.012 color=wingC edge=patC joint
33ball dot on=hindwing at=(.2, -.11, 0) r=(.04, .04, .028) color=patC segs=8 rings=6
34
35// stubby legs and tiny arms
36limb leg on=body at=(.08*S, -.15*S, .05*S) mirror roll=8 len=.1*S r=(.045, .04)*S color=patC segs=8 joint
37limb arm on=body at=(.15*S, -.01*S, .1*S) mirror rot=(-30, 0, 20) len=.08*S r=(.04, .035)*S color=fluffC segs=8 joint
38
39// dust: moon-dust sparkles round the body and off each wing
40fx dust: sparkle on=body n=12 spread=.45 size=.03 color=popC color2=white
41fx dust: sparkle on=wing at=(.25, .15, 0) n=6 spread=.12 size=.025 color=trimC color2=popC
42
43// idle: a soft wing flutter, a hover bob, antennae and head sway
44anim idle: wing flap amp=28 hz=3
45anim idle: hindwing flap amp=20 hz=3 phase=.12
46anim idle: body bob amp=.03 hz=.9
47anim idle: stalk rz sin amp=8 hz=.7 twin=.5
48anim idle: head sway amp=4 hz=.4
49anim idle: leg rx sin amp=10 hz=.9 twin=.5
50// dust: a happy spin with fast wings, arms flung out
51anim dust: body ry spin hz=1.1
52anim dust: body py sin amp=.05 hz=1.1
53anim dust: wing flap amp=40 hz=5
54anim dust: hindwing flap amp=30 hz=5 phase=.1
55anim dust: arm rz keys=[0:0 .3:70 .7:70 1:0] hz=1.1
56anim dust: stalk rx sin amp=14 hz=2.2
57