Kingslayer is a text-based adventure game and library written in Rust.
You can play online here: zaechus.github.io/kingslayer-web
or install Kingslayer:
cargo install kingslayer
kingslayer
or clone the project and run it:
git clone https://github.com/Zaechus/kingslayer
cd kingslayer
cargo run --release
You can make a world like world.ron and run it directly with kingslayer:
kingslayer custom_world.ron
or in a separate program with the kingslayer library:
use kingslayer::*;
fn main() {
let mut game: Game = include_str!("world.ron").parse().unwrap();
game.play().unwrap();
}
Alternatively, you can manually handle input and output with the ask
method (kingslayer-web example).