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.
This commit is contained in:
1 parent
ccfd619a99
commit
5ec164a633
20 files changed
+698
-23
No files matched your search
@@ -39,6 +39,7 @@
|
||||
{"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": "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"}}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
# isokit streets demo: roads with sidewalks, a rounded corner, junctions and a roundabout.
|
||||
# Open it with `isokit studio examples/streets`.
|
||||
title = "isokit streets"
|
||||
note = "Streets drawn along their centre lines: curves carry them round corners, side streets open the sidewalks they join, and the roundabout's kerbs flare into its arms. Tap a street for its numbers. Drag to pan, Ctrl + wheel or pinch to zoom."
|
||||
note = "Streets drawn along their centre lines: curves carry them round corners, side streets open the sidewalks they join, and the roundabout's kerbs flare into its arms. Cars go round the block, a bus, motorbikes, cyclists and people along their routes. Tap a street for its numbers. Drag to pan, Ctrl + wheel or pinch to zoom."
|
||||
default_level = "site"
|
||||
default_rotation = 1
|
||||
prelude = []
|
||||
|
||||
@@ -23,19 +23,19 @@
|
||||
{"id": "tree-3", "type": "tree", "x": 46, "y": -14},
|
||||
{"id": "tree-4", "type": "tree", "x": 48, "y": -34, "props": {"r": 2.4}},
|
||||
{"id": "trees-west", "type": "tree_row", "name": "Avenue trees", "x": -36, "y": 9, "props": {"w": 28}},
|
||||
{"id": "car-1", "type": "car", "x": 30, "y": 1.6, "props": {"moving": true, "travel": 22, "dur": 6, "colour": "car1"}},
|
||||
{"id": "car-2", "type": "car", "x": 44, "y": -1.6, "rot": 180, "props": {"moving": true, "travel": 22, "dur": 7}},
|
||||
{"id": "car-3", "type": "car", "x": -1.6, "y": -30, "rot": 90, "props": {"colour": "car3"}},
|
||||
{"id": "bus", "type": "truck", "name": "Delivery", "x": -40, "y": 1.6, "props": {"len": 7}},
|
||||
{"id": "moto", "type": "moto", "x": 1.6, "y": 26, "rot": 270},
|
||||
{"id": "walker-1", "type": "person", "x": 24, "y": 4.6, "props": {"cls": "guest1"}},
|
||||
{"id": "walker-2", "type": "person", "x": -26, "y": -4.7},
|
||||
{"id": "walker-3", "type": "person", "x": 31.6, "y": 30, "props": {"cls": "guest3"}},
|
||||
{"id": "walker-3", "type": "person", "x": 30, "y": 30, "props": {"cls": "guest3"}},
|
||||
{"id": "crowd", "type": "crowd", "name": "Pupils", "x": -24, "y": -11, "props": {"n": 6, "r": 1.6}},
|
||||
{"id": "lamp-1", "type": "lamp", "x": 18, "y": -5.2},
|
||||
{"id": "lamp-2", "type": "lamp", "x": 44, "y": -5.2},
|
||||
{"id": "lamp-3", "type": "lamp", "x": -28, "y": 5.2},
|
||||
{"id": "lamp-4", "type": "lamp", "x": -44, "y": 5.2},
|
||||
{"id": "lamp-5", "type": "lamp", "x": 5.2, "y": -28}
|
||||
{"id": "lamp-5", "type": "lamp", "x": 5.2, "y": -28},
|
||||
{"id": "traffic", "type": "route", "name": "Traffic round the block", "x": 17.0, "y": 23.0, "pts": [[3.0, -23.0], [17.0, -23.0], [17.0, 23.0], [-5.0, 23.0], [-11.0, 21.392], [-15.392, 17.0], [-17.0, 11.0], [-17.0, -3.0], [-12.408, -11.913], [-5.913, -18.408]], "props": {"kind": "car", "n": 4, "closed": true, "path": false}},
|
||||
{"id": "bus-line", "type": "route", "name": "Bus line", "x": -25.0, "y": -20.0, "pts": [[-25.0, 20.0], [5.0, 20.0], [13.913, 15.408], [20.408, 8.913], [25.0, 0.0], [25.0, -20.0]], "props": {"kind": "bus", "n": 1, "path": false, "colour": "car4"}},
|
||||
{"id": "motos", "type": "route", "name": "Motorbikes", "x": 35.75, "y": -11.75, "pts": [[-8.25, 8.25], [8.25, -8.25]], "props": {"kind": "motorbike", "n": 3, "path": false}},
|
||||
{"id": "cyclists", "type": "route", "name": "Cyclists", "x": 46.5, "y": 46.0, "pts": [[-9.5, 0.0], [9.5, 0.0]], "props": {"kind": "cyclist", "n": 2, "path": false}},
|
||||
{"id": "strollers", "type": "route", "name": "People strolling", "x": 38.0, "y": 23.0, "pts": [[0.0, -17.0], [0.0, 17.0]], "props": {"kind": "person", "n": 3, "path": false}}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user