Voltworm · celworld
seed

Voltworm

voltworm v1Made by APIc4
Open in Playground

v1 cost

$0.157

API, priced from the call usage.

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

Budget

c4 · 48 lines
Shapes36 / 70
Triangles4,886 / 6,000
Draw calls4 / 4
States
idle · charge
Used in
No scene yet
Made
1asset voltworm "Voltworm" complexity=4
2// a chibi spark caterpillar: a big round head with huge eyes and two glowing electrode antennae,
3// a chain of five shrinking body segments each wrapped in a dark battery band with a spark nub on top,
4// stubby bead feet, and a brass "+" terminal for a tail tip.
5// idle: a slither ripple runs down the segments; charge: segments pulse, head rears, antennae sparkle
6let S = .85..1.05
7let shiny = chance(.08)
8let alt = chance(.5)
9let cw = shiny*2 + (1-shiny)*alt
10// colourway 0: sunny cell, 1: lime cell, 2 (rare shiny): bubblegum cell
11let bodyC = sel(cw, sunflower, lime, bubblegum)
12let bandC = sel(cw, navy, navy, plum)
13let trimC = sel(cw, cream, cream, white)
14let popC = sel(cw, cherry, tangerine, aqua)
15
16// front segment: the root bone, belly underside, a collar band
17ball core at=(0, .16*S, 0) r=(.16, .16, .17)*S color=bodyC under=trimC segs=16 rings=10 joint
18torus collar on=core at=(0, 0, -.02*S) rot=(90, 0, 0) R=.155*S r=.03*S color=bandC segs=18 sides=6
19ball cfoot on=core at=(.1*S, -.125*S, .04*S) mirror r=.05*S color=trimC segs=6 rings=4
20
21// the body chain: five segments that shrink toward the tail, sitting on the ground
22ball seg x5 on=core at=(0, -.016*S, -.21*S) chain=(0, -.016*S, -.21*S) scale=.88 r=.15*S color=bodyC under=trimC segs=12 rings=8 joint
23torus band on=seg rot=(90, 0, 0) R=.145*S r=.03*S color=bandC segs=14 sides=5
24ball foot on=seg at=(.09*S, -.11*S, 0) mirror r=.05*S color=trimC segs=6 rings=4
25cone spark on=seg surf=(0, 90) lift=-.02*S h=.08*S r=.045*S color=popC segs=6
26cyl term on=seg if=parent.i==4 at=(0, 0, -.13*S) rot=(-90, 0, 0) h=.07*S r=.05*S round=.015*S color=brass segs=10
27
28// the big head
29ball head on=core at=(0, .2*S, .1*S) r=(.2, .19, .18)*S color=bodyC under=trimC segs=22 rings=14 joint
30face look on=head eyes=round mouth=smile size=.27 spacing=27 eyeY=6 mouthY=-26 mouthW=.3 iris=bandC detail=.6
31
32// electrode antennae with glowing tips
33rod antenna on=head at=(.07*S, .15*S, .02*S) mirror to=(.07, .19, .03)*S r=(.022, .018)*S sides=6 color=bandC joint
34ball tip on=antenna at=end r=.045*S color=glow ink=glow segs=8 rings=6
35
36// charge sparks at the antenna tips
37fx charge: sparkle on=tip n=6 spread=.12 hz=1.4 size=.03 color=sunflower color2=white
38
39// idle: a slither ripple down the chain, a gentle nod and antenna sway
40anim idle: seg ry sin amp=9 hz=.7 stagger=.14
41anim idle: core breathe
42anim idle: head nod amp=5 hz=.5
43anim idle: antenna rz sin amp=6 hz=.6 twin=.5
44// charge: segments pulse in a running wave, the head rears up, antennae quiver
45anim charge: seg s sin amp=.1 hz=2.5 stagger=.18
46anim charge: head rx keys=[0:0 .3:-14 .7:-14 1:0] hz=.8
47anim charge: antenna rz sin amp=12 hz=5 twin=.5
48anim charge: core py bounce amp=.02 hz=2.5
49