Files
isokit/examples/country/scene.json
T
grabowski 5ec164a633
Deploy web Studio / deploy (push) Successful in 1m4s
Routes: movers along waypoints (roadmap 8)
New route prefab (routes.rhai): cars, buses, motorbikes, cyclists, people,
deer or elephants move along waypoints, round a loop or there and back.
Each way keeps to the left of the line (or right), corners are rounded
into pieces of at most 45 degrees; there-and-back routes become loops with
U-turns, so the two directions never share a strip.

Engine: Prim::Travel / sprite.begin_travel / script travel(a, b, dur,
windows) ... end(): the mover is drawn at a piece's start and slides to
its end while it is on that piece, hidden otherwise. The renderer writes
keyframes per piece (named by a hash of their content) into one <style>
per view. Each piece is its own sprite with the lane strip as its sort
extent (ext_reset), mitred at the corners, so movers pass in front of and
behind trees, lamps and houses. Movers that look alike and never meet on
a piece share one drawing. iso-travel pauses (not hides) in still,
reduced-motion and ghosted views.

Studio: meta shape "path" draws point by point (snapping like runs) and
saves one object with pts; ending on the first point closes the loop.
MCP: pts in the object schema, route guidance.

Demos: streets gets traffic round the block, a bus, motorbikes, cyclists
and strolling people (replacing the one-axis cars); country gets cars on
the lane.

Tests: Rust 79 (each mover on exactly one piece at every moment, in every
rotation), Studio 125, web 99.
2026-10-25 17:52:17 +07:00

46 lines
4.9 KiB
JSON

{
"version": 1,
"objects": [
{"id": "ground", "type": "area", "name": "Meadows", "x": 0, "y": 0, "rot": 0, "props": {"w": 96, "d": 74, "mat": "g-grass"}},
{"id": "lane-w", "type": "road", "name": "Lane (west)", "x": -30.0, "y": -30.0, "rot": 0.0, "props": {"w": 36.0, "d": 4.5, "dashed": false, "kerb": false}},
{"id": "lane-d", "type": "road", "name": "Lane (diagonal)", "x": 3.0, "y": -15.0, "rot": 45.0, "props": {"w": 42.426, "d": 4.5, "dashed": false, "kerb": false}},
{"id": "lane-n", "type": "road", "name": "Lane (north)", "x": 18.0, "y": 18.5, "rot": 90.0, "props": {"w": 37.0, "d": 4.5, "dashed": false, "kerb": false}},
{"id": "paddock-1", "type": "fence", "name": "Paddock fence", "x": -33.0, "y": -6.0, "rot": 0.0, "props": {"w": 22.0, "style": "wood", "h": 1.6}},
{"id": "paddock-2", "type": "fence", "name": "Paddock fence", "x": -18.0, "y": -2.0, "rot": 45.0, "props": {"w": 11.314, "style": "wood", "h": 1.6}},
{"id": "paddock-3", "type": "fence", "name": "Paddock fence", "x": -14.0, "y": 14.0, "rot": 90.0, "props": {"w": 24.0, "style": "wood", "h": 1.6}},
{"id": "paddock-4", "type": "fence", "name": "Paddock fence", "x": -29.0, "y": 26.0, "rot": 180.0, "props": {"w": 30.0, "style": "wood", "h": 1.6}},
{"id": "paddock-5", "type": "fence", "name": "Paddock fence", "x": -44.0, "y": 10.0, "rot": 270.0, "props": {"w": 32.0, "style": "wood", "h": 1.6}},
{"id": "elephants", "type": "elephant", "name": "Elephants", "x": -29, "y": 11, "rot": 330, "props": {"n": 3, "mix": "herd", "r": 6}},
{"id": "pad-rocks", "type": "rocks", "name": "Rocks", "x": -38, "y": 20, "rot": 0, "props": {"n": 3, "r": 0.8, "spread": 2}},
{"id": "pad-tree", "type": "tree", "x": -20, "y": 21, "rot": 0, "props": {"r": 2.2}},
{"id": "forest-1", "type": "tree_row", "name": "Forest edge", "x": 36, "y": 34, "rot": 0, "props": {"w": 26, "spacing": 4, "r": 2.0}},
{"id": "forest-2", "type": "tree_row", "x": 36, "y": 29, "rot": 0, "props": {"w": 24, "spacing": 5, "r": 1.8}},
{"id": "tree-1", "type": "tree", "x": 24, "y": 24, "rot": 0, "props": {"r": 1.6}},
{"id": "tree-2", "type": "tree", "x": 41, "y": 22, "rot": 0, "props": {"r": 2.0}},
{"id": "tree-3", "type": "tree", "x": -6, "y": 34, "rot": 0, "props": {"r": 1.8}},
{"id": "tree-4", "type": "tree", "x": 4, "y": 33, "rot": 0, "props": {"r": 2.1}},
{"id": "tree-5", "type": "tree", "x": -2, "y": 29, "rot": 0, "props": {"r": 1.5}},
{"id": "deer", "type": "deer", "name": "Deer", "x": 30, "y": 14, "rot": 200, "props": {"n": 6, "r": 5}},
{"id": "boar", "type": "boar", "name": "Wild boar", "x": 40, "y": 28, "rot": 170, "props": {"n": 3, "r": 2.5}},
{"id": "log", "type": "log", "name": "Fallen log", "x": 8, "y": 28, "rot": 20, "props": {"w": 4, "r": 0.3}},
{"id": "stump", "type": "log", "x": 12, "y": 31, "rot": 0, "props": {"kind": "stump", "r": 0.4}},
{"id": "fox", "type": "fox", "name": "Fox", "x": 6, "y": 16, "rot": 300, "props": {"n": 1}},
{"id": "hedge-1", "type": "hedge", "name": "Hedgerow", "x": 2.0, "y": -8.0, "rot": 45.0, "props": {"w": 22.627, "d": 0.9, "h": 1.5}},
{"id": "hedge-2", "type": "hedge", "name": "Hedgerow", "x": 10.0, "y": 5.0, "rot": 90.0, "props": {"w": 10.0, "d": 0.9, "h": 1.5}},
{"id": "bush-1", "type": "bush", "x": -8, "y": -18, "rot": 0, "props": {"r": 1.0, "kind": "berries"}},
{"id": "bush-2", "type": "bush", "x": 12, "y": 12, "rot": 0, "props": {"r": 0.9, "kind": "flowering", "colour": "white"}},
{"id": "bush-3", "type": "bush", "x": 2, "y": -4, "rot": 0, "props": {"r": 0.7}},
{"id": "meadow", "type": "flowers", "name": "Wildflower meadow", "x": 4, "y": -29, "rot": 0, "props": {"w": 18, "d": 7, "kind": "meadow", "density": 5}},
{"id": "hives", "type": "beehive", "name": "Apiary", "x": 31, "y": -22, "rot": 0, "props": {"n": 4, "gap": 1.0}},
{"id": "butterflies", "type": "butterflies", "x": 4, "y": -29, "rot": 0, "props": {"n": 8, "r": 4}},
{"id": "bed", "type": "flowers", "name": "Flower bed", "x": 31, "y": -27, "rot": 0, "props": {"w": 6, "d": 2, "kind": "bed", "colour": "mixed"}},
{"id": "rabbits", "type": "rabbits", "name": "Rabbits", "x": -28, "y": -20, "rot": 0, "props": {"n": 5, "r": 2.5}},
{"id": "bush-4", "type": "bush", "x": -20, "y": -22, "rot": 0, "props": {"r": 1.2}},
{"id": "bush-5", "type": "bush", "x": -36, "y": -18, "rot": 0, "props": {"r": 0.8, "kind": "flowering", "colour": "pink"}},
{"id": "pond", "type": "pond", "name": "Pond", "x": 36, "y": -6, "rot": 0, "props": {"w": 11, "d": 8, "fish": 6, "lilies": 4}},
{"id": "pond-rocks", "type": "rocks", "x": 42, "y": -1, "rot": 0, "props": {"n": 2, "r": 0.6, "spread": 1}},
{"id": "birds", "type": "birds", "name": "Birds", "x": 0, "y": 0, "rot": 0, "props": {"n": 10, "h": 18, "r": 14}},
{"id": "lane-cars", "type": "route", "name": "Cars on the lane", "x": -14.0, "y": 2.5, "pts": [[-32.0, -32.5], [2.0, -32.5], [32.0, -2.5], [32.0, 32.5]], "props": {"kind": "car", "n": 2, "path": false, "colour": "mixed"}}
]
}