Townsperson · celworld
seed

Townsperson

figure v1Hand-writtenc5
Open in PlaygroundExplain this script

How v1 was made

Hand-written

Written by hand in .cel.

Script
40 lines

Budget

c5 · 40 lines
Shapes21 / 100
Triangles7,474 / 8,000
Draw calls2 / 4
States
walk · cheer
Used in
No scene yet
Made
1asset figure "Townsperson" ref=person complexity=5
2// a person-scale chibi in the house style: a round head with the house face, a superellipse
3// torso, sleeve and sock bands, a hair cap (bowl, bob or bun); arms and legs swing
4let S = .82..1.12
5let R = .19..0.22
6let skin = skin0|skin1|skin2|skin3|skin4|skin5|skin6|skin7|skin8|skin9
7let shirt = cherry|tangerine|sunflower|lime|teal|cobalt|grape|pink|coral|white|navy|bottle
8let pants = denim:3|navy|iron|oak|bottle|plum|cream
9let shoeC = iron:2|walnut|cherry|white|cobalt
10let sock = white:2|cream|sunflower|pink
11let hairC = hairBlack:3|hairBrown:3|hairAuburn|hairGinger|hairBlonde:2|hairGrey|hairPink:.3|hairTeal:.3
12let style = "bowl":3|"bob":2|"bun"
13let SL = .45:2|.9
14
15// body: the pelvis is the root, everything scales with it
16lathe pelvis at=(0, .6*S, 0) h=.16 r=.16 prof=[0:.86 .5:1 1:1] sq=3 depth=.72 color=pants scale=S joint
17lathe torso on=pelvis at=(0, .15, 0) h=.36 r=.16 prof=[0:1 .55:1.05 .86:.98 1:.6] sq=3 depth=.72 color=shirt
18cyl neck on=torso at=(0, .33, 0) h=.08 r=.05 color=skin
19ball head on=torso at=(0, .38+R, 0) r=(R, R*.98, R*.94) color=skin joint
20face look on=head eyes=round:3|dot|happy|sleepy mouth=smile:3|grin|open|flat|cat blush=chance(.4) iris=#5a3a28|#3a6a8a|#4a6a3a|#2a2a3a brows=hairC*.7
21ball ear on=head surf=(86, -6) upright mirror r=(R*.1, R*.18, R*.13) color=skin*.84
22ball nose on=head surf=(0, -14) upright lift=-R*.03 r=(R*.1, R*.09, R*.09) color=skin*.84 if=chance(.6)
23
24// hair
25ball cap on=head at=(0, R*.1, -R*.08) r=(R*1.05, R*1.02, R*1.06) half rot=(-34, 0, 0) color=hairC segs=18 rings=7
26ball fringe x3 on=head surf=(-32+t*64, 40) decal lift=-R*.03 r=(R*.34, R*.2, R*.12) color=hairC segs=10 rings=5
27ball bobback on=head at=(0, -R*.12, -R*.2) r=(R*1.1, R*.9, R*.96) color=hairC if=style=="bob"
28ball bun on=head surf=(180, 50) upright lift=-R*.08 r=R*.4 color=hairC if=style=="bun"
29
30// arms and legs
31limb arm on=torso at=(.175, .265, 0) mirror roll=7 len=.42 r=(.062, .05) bands=[SL:skin] color=shirt joint
32ball hand on=arm at=end r=.058 color=skin
33limb leg on=pelvis at=(.08, .04, 0) mirror len=.52 r=(.088, .07) bands=[.8:sock] color=pants joint
34ball shoe on=leg at=end+(0, -.12, .04) r=(.074, .08, .13) half color=shoeC
35
36// idle always; walk and cheer are named states a game triggers
37anim head sway amp=3 hz=.45
38anim walk: leg gait
39anim walk: arm gait amp=16 phase=.5
40anim cheer: arm rz keys=[0:0 .3:150 .5:135 .7:150 1:0] hz=.7
41