From d36c54d996f3c14ae811312dbbe621e12a39edde Mon Sep 17 00:00:00 2001 From: skylar Date: Tue, 10 Nov 2026 06:50:08 -0800 Subject: Orrery: game loop, name generator and derelict dungeons An ASCII sci-fi-fantasy game for the terminal, built on ratatui. - Game loop with a fixed 30 Hz tick and a stack of scenes; the kitty keyboard protocol is turned on where the terminal supports it, so later real-time scenes can tell when a key is held. - Stable hierarchical seeds: the whole universe derives from one u64, with tests pinning the exact outputs so old seeds keep working. - Name generator with four cultures, each with its own syllables and templates, plus unidentified/true names for artifacts. - Title screen with an animated orrery, and a name forge for browsing generated names. - Derelict ships to board: ship-shaped maps with an engine room, spine corridor, side rooms and bridge; symmetric shadowcasting sight; monsters that wake on sight and hunt; loot carried out through the airlock goes into the hold. - `orrery names` and `orrery ship` print the generators' output without the TUI, for tuning. Co-Authored-By: Claude Opus 5.5 --- src/main.rs | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/main.rs (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e2b74d3 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,43 @@ +//! Orrery: an ASCII sci-fi-fantasy game. +//! +//! `orrery` plays; `orrery names` and `orrery ship` print what the +//! generators make, without the TUI. + +mod app; +mod cli; +mod dungeon; +mod names; +mod scenes; +mod seed; +mod term; + +use std::process::ExitCode; + +fn main() -> ExitCode { + let args: Vec = std::env::args().skip(1).collect(); + match cli::parse(&args) { + Ok(cli::Command::Play { seed }) => match app::run(seed.unwrap_or_else(seed::from_clock)) { + Ok(()) => ExitCode::SUCCESS, + Err(e) => { + eprintln!("orrery: {e}"); + ExitCode::FAILURE + } + }, + Ok(cli::Command::Names(opts)) => { + cli::print_names(&opts); + ExitCode::SUCCESS + } + Ok(cli::Command::Ship { seed, which }) => { + cli::print_ship(seed, which); + ExitCode::SUCCESS + } + Ok(cli::Command::Help) => { + print!("{}", cli::USAGE); + ExitCode::SUCCESS + } + Err(msg) => { + eprintln!("orrery: {msg}\n\n{}", cli::USAGE); + ExitCode::from(2) + } + } +} -- cgit v1.2.3