# rts-prototype Pure-RTS composer-demo integrating the P.3.4-P.3.7 libs (camera free-pan, input actions, selection, command). 8 units in 3 speed-classes on a 20x20 tile-map; LMB selects, RMB moves. **Version:** 0.1.0 **Module-ID:** rts-prototype **Requires:** lib-core.maps v>=0.1.1, lib-core.render v>=0.1.0, lib-core.camera v>=0.3.0, lib-core.input v>=0.4.0, lib-core.selection v>=0.1.0, lib-core.command v>=0.1.0 **Tags:** rts, tech-demo, composition ## Topology ```mermaid graph LR this["rts-prototype"] lib_core_maps["lib-core.maps"] this --> lib_core_maps lib_core_render["lib-core.render"] this --> lib_core_render lib_core_camera["lib-core.camera"] this --> lib_core_camera lib_core_input["lib-core.input"] this --> lib_core_input lib_core_selection["lib-core.selection"] this --> lib_core_selection lib_core_command["lib-core.command"] this --> lib_core_command engine["engine.*"] this --> engine ``` ## Controls - **LMB-Click**: Select a unit - **LMB-Drag**: Box-select multiple units - **Shift+LMB**: Add to selection - **Ctrl+LMB**: Toggle unit in selection - **RMB-Click**: Move selected units to clicked map-position - **WASD / Arrows**: Pan camera - **Mouse-Edge**: Edge-scroll camera - **Middle-Drag**: Pan camera by dragging - **ESC**: Return to launcher ## Demonstrates - Pure-composition module: no game-logic libs, just maps + render + camera + input + selection + command wired together. - 8 units in 3 speed-classes (red=100, brown=150, yellow=200 px/s) clustered in the left half of a 20x20 map; speed-variation visible on cross-map moves. - Direct-line move (no pathfinding — units walk through wall-clusters; pathfinding deferred to P.4). - Free-pan camera with all three pan-sources (keys, edge-scroll, middle-drag) simultaneously enabled. - `engine.switch_module("lib-management.launcher")` on ESC to return to the launcher chooser. ## Interactions The selection -> command bridge is a one-line target-provider registration. `command` does not know about `selection`; the module wires them together: ```lua command.bind_move_action("rmb") command.bind_target_provider(function() return selection.list() end) ``` Camera setup composes all three pan-sources at once, then `camera.update(dt)` sums them per-frame: ```lua camera.bind_pan_keys("pan_left", "pan_right", "pan_up", "pan_down") camera.bind_pan_drag("pan_drag") camera.enable_pan_edge() ``` ## References - meta/docs/superpowers/specs/2026-05-14-p3-8-rts-prototype-design.md - meta/docs/architecture/lib-composition.md