Zapkit · celworld
seed

Zapkit

zapkit v1Made by APIc4
Open in Playground

v1 cost

$0.208

API, priced from the call usage.

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

Budget

c4 · 53 lines
Shapes20 / 70
Triangles5,612 / 6,000
Draw calls4 / 4
States
idle · zap
Made
1asset zapkit "Zapkit" complexity=4
2// a spark kit: a chibi fox-ish quadruped with huge ears, puffed cheeks with lightning marks,
3// a fat zigzag bolt tail; idle twitches its ears and wags, zap spins it in a shower of sparks
4let S = .92..1.08
5let earS = .9..1.15
6let TL = .9..1.12
7// colourways: 0 sunny, 1 ember, 2 rare shiny
8let shiny = chance(.08)
9let alt = chance(.5)
10let way = shiny*2 + (1-shiny)*alt
11let coatC = sel(way, sunflower, tangerine, sky)
12let paleC = sel(way, cream, cream, white)
13let tipC = sel(way, walnut, inkDark, navy)
14let boltC = sel(way, cherry, lemon, bubblegum)
15let eyeC = sel(way, walnut, navy, plum)
16
17// body: root bone on four short socked legs
18ball body at=(0, .27*S, 0) r=(.15, .14, .2)*S color=coatC under=paleC segs=20 rings=12 joint
19limb leg x2 on=body row=(0, 0, .22*S) at=(.085*S, -.02*S, 0) mirror len=.2*S r=(.055, .048)*S bands=[.62:tipC] color=coatC segs=10 joint
20ball ruff on=body surf=(0, 25) upright lift=-.07*S r=(.11, .1, .08)*S color=paleC segs=12 rings=8
21
22// big head with fluffy cheeks and a small muzzle
23ball head on=body at=(0, .19*S, .17*S) r=(.2, .18, .17)*S color=coatC under=paleC segs=22 rings=14 joint
24ball fluff on=head surf=(80, -22) upright lift=-.08*S mirror r=(.08, .065, .075)*S color=coatC segs=12 rings=7
25ball muzzle on=head surf=(0, -28) upright lift=-.07*S r=(.09, .06, .07)*S color=paleC segs=12 rings=7
26ball nose on=muzzle surf=(0, 25) upright lift=-.012*S r=(.026, .02, .02)*S color=inkDark segs=8 rings=5
27face look on=head eyes=round mouth=cat size=.26 spacing=27 eyeY=8 mouthY=-32 mouthW=.25 iris=eyeC detail=.8
28
29// lightning cheek marks, lying on the cheeks (sized with scale=)
30slab spark on=head surf=(52, -14) decal lift=-.012*S mirror scale=S pts=[-.02,.045 .035,.045 .008,.008 .035,.008 -.028,-.05 -.006,-.006 -.032,-.006] t=.03 round=.01 color=boltC
31
32// tall ears with dark tips and pale insides
33cone ear on=head surf=(32, 52) lift=-.03*S mirror h=.22*S*earS r=.08*S r2=.012*S depth=.55 bands=[.72:tipC] color=coatC segs=10 joint
34cone inner on=ear at=(0, .015*S, .024*S) h=.15*S*earS r=.05*S r2=.008*S depth=.4 color=paleC segs=8
35
36// the zigzag bolt tail with a coloured rim (sized with scale=)
37ball tailroot on=body at=(0, .04*S, -.18*S) r=.06*S color=coatC segs=10 rings=6 joint
38slab tail on=tailroot at=(0, .01*S, -.02*S) yaw=90 scale=S*TL pts=[0,0 .06,-.02 .16,.12 .12,.14 .24,.28 .2,.3 .36,.5 .14,.34 .18,.32 .05,.2 .09,.18 -.04,.05] t=.055 round=.025 color=coatC edge=boltC
39
40// zap: sparkles round the body and the cheeks
41fx zap: sparkle on=body n=12 spread=.38 size=.035 hz=1.4 color=lemon
42fx zap: sparkle on=head at=(0, -.04, .1) n=8 spread=.22 size=.03 hz=1.8 color=boltC
43
44// idle: ear twitch, tail wag, breathing, a curious head tilt
45anim idle: ear rz keys=[0:0 .08:-16 .16:4 .24:0 1:0] hz=.55 twin=.35
46anim idle: tailroot wag amp=22 hz=1.6
47anim idle: body breathe
48anim idle: head rz sin amp=5 hz=.3
49// zap: spin on the spot with a hop, tail flicked up
50anim zap: body ry spin hz=1.2
51anim zap: body py bounce amp=.05 hz=2.4
52anim zap: tailroot rx keys=[0:0 .3:-25 .7:-25 1:0] hz=1.2
53anim zap: ear rx keys=[0:0 .5:-15 1:0] hz=2.4
54