Kingslayer

Build Status

A text adventure dungeon crawler game written in Rust.

Creating and Running a World

Worlds are defined with JSON. An example can be found on the wiki. Deploying the world file in Rust looks like this: ``` use kingslayer::Cli;

fn main() { let cli = Cli::fromjsonfile("data/world.json");

cli.start();

} or the loop can be managed manually like this: use kingslayer::Cli;

fn main() { let cli = Cli::fromjsonfile("data/world.json");

println!("{}", cli.ask("l"));
loop {
    match cli.ask(&cli.prompt()) {
        s => {
            println!("{}", s);
            if s.contains("You died.") {
                break;
            }
        }
    }
}

} ```