https://github.com/Zaechus/kingslayer
A text-based adventure written in Rust
https://github.com/Zaechus/kingslayer
adventure-game cargo dungeon game interactive-fiction ron rust wasm webassembly
Last synced: 2 months ago
JSON representation
A text-based adventure written in Rust
- Host: GitHub
- URL: https://github.com/Zaechus/kingslayer
- Owner: Zaechus
- License: mit
- Created: 2018-08-30T21:56:08.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-11-15T00:42:03.000Z (8 months ago)
- Last Synced: 2024-11-15T01:27:18.809Z (8 months ago)
- Topics: adventure-game, cargo, dungeon, game, interactive-fiction, ron, rust, wasm, webassembly
- Language: Rust
- Homepage: https://zaechus.github.io/kingslayer-web
- Size: 937 KB
- Stars: 39
- Watchers: 3
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 👑 Kingslayer ⚔️
[](https://github.com/Zaechus/kingslayer/actions/workflows/ci.yml)
[](https://crates.io/crates/kingslayer)
[](https://docs.rs/kingslayer)Kingslayer is a text-based adventure game and library written in Rust.
## Playing the game
You can play online here: [zaechus.github.io/kingslayer-web](https://zaechus.github.io/kingslayer-web/)
or install Kingslayer:
```sh
cargo install kingslayer
kingslayer
```
or clone the project and run it:
```sh
git clone https://github.com/Zaechus/kingslayer
cd kingslayer
cargo run --release
```## Making a game
You can make a world like [world.ron](https://github.com/Zaechus/kingslayer/blob/main/src/world.ron) and run it directly with kingslayer:
```sh
kingslayer custom_world.ron
```
or in a separate program with the kingslayer library:
```rust
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](https://github.com/Zaechus/kingslayer-web/blob/main/docs/index.js)).