#dungeon #adventure #text-adventure #web-crawler #text

bin+lib kingslayer

A text adventure dungeon crawler game written in Rust

12 releases

0.5.5 Mar 18, 2022
0.5.4 May 24, 2021
0.5.2 Mar 16, 2020
0.4.3 Oct 29, 2019
0.2.1 Mar 25, 2019

#234 in Games

43 downloads per month

MIT license

120KB
3.5K SLoC

Rust 3K SLoC // 0.0% comments Rusty Object Notation 361 SLoC

👑 Kingslayer ⚔️

CI Crates.io Kingslayer documentation

Kingslayer is a text-based dungeon crawler written in Rust. It is a continuation of thekinggame.

Playing the game

You can play an online WASM version here: zaechus.github.io/kingslayer-web

You can also install Kingslayer:

cargo install kingslayer
kingslayer

or clone the project and run it:

cargo run --release

Creating and Running your own World

Worlds can be created with RON and Rust helper functions. Running the world on the command line looks like this:

use kingslayer::Cli;

fn main() {
    let cli = Cli::from_file("worlds/world.ron");

    cli.start();
}

or the loop can be managed manually like this:

use kingslayer::Cli;

fn main() {
    let cli = Cli::from_file("worlds/world.ron");

    println!("{}", cli.ask("l"));
    loop {
        let s = cli.ask(&Cli::prompt());
        println!("{}", s);
        if s.contains("Farewell.") {
            break;
        }
    }
}

This method allows for other forms of input and output such as within a website. The content for the world can also be passed as a raw string with Cli::from_ron_str.

Dependencies

  • Rust/Cargo ^1.59.0

Dependencies

~2.4–3.5MB
~72K SLoC