dreamstack/examples/streaming-physics.ds
enzotar e2570b5df4 feat(examples): add streaming-physics.ds, mark all roadmap items complete
- streaming-physics.ds: physics scene streaming via named /source/physics channel
- Updated BITSTREAM_INTEGRATION.md: Phase B/C items marked 
- 95 tests, 0 failures across workspace
2026-02-25 14:53:12 -08:00

28 lines
864 B
Text

-- DreamStack Streaming Physics
-- Physics scene that streams body positions to remote receivers.
-- Receivers see balls and boxes moving in real time.
--
-- Run with:
-- cargo run -p ds-stream &
-- dreamstack stream examples/streaming-physics.ds
let gravity_y = 980
stream main on "ws://localhost:9100/source/physics" { mode: signal }
view main = column [
text "Streaming Physics"
scene { width: 700, height: 450, gravity_y: gravity_y } [
circle { x: 200, y: 80, radius: 35, color: "#8b5cf6" }
circle { x: 350, y: 50, radius: 50, color: "#6366f1" }
rect { x: 500, y: 100, width: 80, height: 50, color: "#10b981" }
circle { x: 150, y: 180, radius: 25, color: "#f59e0b" }
]
row [
button "Anti-Gravity" { click: gravity_y = -500 }
button "Normal" { click: gravity_y = 980 }
button "Zero-G" { click: gravity_y = 0 }
]
]