Steam tractor · celworld
seed

Steam tractor

steam_tractor v1Made by APIc5
Open in Playground

v1 cost

$0.266

API, priced from the call usage.

The run, with the maths
All 1 version$0.266

Budget

c5 · 59 lines
Shapes26 / 100
Triangles6,630 / 8,000
Draw calls3 / 4
States
drive · toot
Used in
No scene yet
Made
1asset steam_tractor "Steam tractor" complexity=5
2// a tiny steam tractor: a fat rounded boiler with a smiling face, a tall flared chimney that puffs,
3// huge rear wheels and small front ones, a striped canopy over a seat, brass rings and lamps
4// readable from afar: the big back wheels, the chimney and the round happy boiler
5let BR = .5..0.6
6let FR = .27..0.33
7let CH = .65..0.8
8let body = cherry:3|teal:2|cobalt|sunflower|mint:2|coral
9let trim = cream:3|white
10let darkC = iron:2|greystone|walnut
11let popC = brass:3|marigold|copper
12
13// chassis frame: the root bone, with axles and the towing hitch
14box chassis at=(0, .28, 0) size=(.7, .2, 2.1) round=.07 color=darkC joint
15rod axleB on=chassis at=(-.5, BR-.28, -.65) to=(1, 0, 0) r=.06 sides=8 color=darkC
16rod axleF on=chassis at=(-.45, FR-.28, .85) to=(.9, 0, 0) r=.05 sides=8 color=darkC
17box hitch on=chassis at=(0, .04, -1.0) size=(.18, .1, .25) round=.03 color=popC
18
19// the boiler: a long fat ellipsoid with a pale belly and brass hoops
20ball boiler on=chassis at=(0, .5, .1) r=(.44, .44, .8) color=body under=trim segs=28 rings=16 joint
21torus hoop x2 on=boiler row=(0, 0, .6) at=(0, 0, 0) rot=(90, 0, 0) R=.41 r=.035 segs=24 sides=6 color=popC
22ball dome on=boiler at=(0, .37, -.05) r=(.14, .13, .14) color=popC segs=12 rings=8
23cyl whistle on=boiler at=(0, .3, -.4) h=.2 r=.045 round=.02 color=popC segs=10 joint
24
25// the chimney: flared top with a brass rim, three steam puffs above it
26lathe chimney on=boiler at=(0, .28, .5) h=CH r=.12 prof=[0:1 .55:.75 .85:.8 1:1.35] bands=[.9:popC] color=darkC segs=16 rings=10
27puff smoke x3 on=chimney at=(0, CH+.1, 0) row=(0, .22, 0) r=.12+.03*i color=white noise=.05 segs=12 rings=8 joint
28
29// face on the boiler front, lamps on the chassis nose
30face look on=boiler eyes=round mouth=smile blush size=.2 spacing=26 eyeY=12 mouthY=-22 mouthW=.35 detail=.6
31ball lamp on=chassis at=(.2, .3, 1.12) mirror r=(.1, .1, .07) color=glow ink=glow segs=10 rings=6
32
33// seat and striped canopy on four slim posts
34box seat on=chassis at=(0, .12, -.82) size=(.45, .3, .3) round=.06 color=body*.85
35rod post x2 on=chassis row=(0, 0, .55) at=(.34, .18, -.65) mirror to=(.06, .97, 0) r=.04 sides=6 color=popC
36box roof on=chassis at=(0, 1.12, -.55) size=(1.0, .1, .95) round=.04 stripes=[body trim] panels=6 color=body
37
38// wheels: big rear pair, small front pair
39wheel wheel on=chassis at=(.55, BR-.28, -.65) mirror r=BR w=.3 hub=trim tyre=tyre joint
40wheel fwheel on=chassis at=(.42, FR-.28, .85) mirror r=FR w=.18 hub=trim tyre=tyre joint
41
42// idle: engine rumble, a breathing boiler, steam rising from the chimney
43anim chassis py sin amp=.006 hz=5
44anim boiler breathe
45anim smoke py keys=[0:0 1:.7] hz=.4 stagger=.33
46anim smoke s keys=[0:-.75 .2:0 .7:.2 1:-.9] hz=.4 stagger=.33
47
48// drive: wheels roll in step (front ones turn faster), the body rocks, chuffs come quicker
49anim drive: wheel rx spin hz=.6
50anim drive: fwheel rx spin hz=1.1
51anim drive: chassis rz sin amp=1.2 hz=3
52anim drive: chassis rx sin amp=1 hz=2
53anim drive: smoke py keys=[0:0 1:.7] hz=.9 stagger=.33
54anim drive: smoke s keys=[0:-.75 .2:0 .7:.2 1:-.9] hz=.9 stagger=.33
55
56// toot: the whistle swells and the boiler puffs up, steam bursts out of the chimney
57anim toot: whistle s keys=[0:0 .15:.6 .6:.4 1:0] hz=.8 once
58anim toot: boiler s keys=[0:0 .2:.06 1:0] hz=.8 once
59anim toot: smoke s keys=[0:-.5 .3:.6 1:-.9] hz=1 stagger=.2 once
60