25 lines
843 B
Text
25 lines
843 B
Text
|
|
-- DreamStack Physics Demo
|
||
|
|
-- Rapier2D-powered rigid body physics, driven from the .ds language
|
||
|
|
-- Gravity, collision, rotation — all from a scene declaration
|
||
|
|
|
||
|
|
let gravity_y = 980
|
||
|
|
|
||
|
|
view main = column [
|
||
|
|
text "⚡ DreamStack 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" }
|
||
|
|
rect { x: 300, y: 200, width: 60, height: 60, color: "#14b8a6" }
|
||
|
|
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 }
|
||
|
|
button "🪐 Heavy" { click: gravity_y = 2000 }
|
||
|
|
]
|
||
|
|
]
|