kin
kingslayer
cargo install kingslayer
kin

kingslayer

A text-based dungeon adventure written in Rust

by Maxwell Anderson

0.5.2 (see all)License:MIT
cargo install kingslayer
Readme

👑 Kingslayer ⚔️

Rust Crates.io Kingslayer documentation license/MIT

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

Playing the game

You can play the online WASM version here: maxgy.github.io/kingslayer-web

You can also install Kingslayer:

cargo install kingslayer
kingslayer

or clone the project and run:

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("You died.") {
            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 ^1.41.0

Crates

  • rand = "0.7"
  • rayon = "1.0"
  • serde = "1.0"
  • ron = "0.5"

GitHub Stars

16

LAST COMMIT

2yrs ago

MAINTAINERS

1

CONTRIBUTORS

2

OPEN ISSUES

4

OPEN PRs

0
VersionTagPublished
0.5.2
2yrs ago
0.5.1
2yrs ago
0.5.0
2yrs ago
0.4.3
3yrs ago
No alternatives found
No tutorials found
Add a tutorial