#text #adventure #game #crawler #dungeon

bin+lib kingslayer

A text adventure dungeon crawler game written in Rust

7 releases

✓ Uses Rust 2018 edition

0.4.3 Oct 29, 2019
0.4.2 Sep 30, 2019
0.4.0 Aug 27, 2019
0.2.1 Mar 25, 2019
0.1.0 Mar 10, 2019

#16 in Games

Download history 24/week @ 2019-10-01 4/week @ 2019-10-08 6/week @ 2019-10-15 46/week @ 2019-10-22 32/week @ 2019-10-29 16/week @ 2019-11-05 11/week @ 2019-11-12 15/week @ 2019-11-19 16/week @ 2019-11-26 14/week @ 2019-12-03 67/week @ 2019-12-10 7/week @ 2019-12-24 1/week @ 2019-12-31 128/week @ 2020-01-07

96 downloads per month

MIT license

87KB
2.5K SLoC

Rust 2K SLoC // 0.0% comments Rusty Object Notation 312 SLoC

👑 Kingslayer ⚔️

Current Crates.io Version Kingslayer documentation Build Status Build status

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

You can find the WASM package at github.com/Maxgy/kingslayer-wasm

Running the game

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

or clone the project and run:

cargo run --release

Creating and Running your own World

Worlds can be created with RON or JSON. Running the world on the command line looks like this:

use kingslayer::Cli;

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

    cli.start();
}

or the loop can be managed manually like this:

use kingslayer::Cli;

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

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

This method allows you to manage 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 or Cli::from_json_str.

Dependencies

  • Rust ^1.38.0

Crates

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

Dependencies

~3.5MB
~71K SLoC