Add game controls to README

This commit is contained in:
Timothy Warren 2022-02-04 11:07:54 -05:00
parent 0c5cec84e9
commit 70711572e8

View File

@ -3,19 +3,68 @@
A rogue-like game, implemented in Rust, with the `specs` ECS library, and `rltk` roguelike toolkit. A rogue-like game, implemented in Rust, with the `specs` ECS library, and `rltk` roguelike toolkit.
## Rust Setup ## Rust Setup
Follow the instructions on the [Getting Started](https://www.rust-lang.org/learn/get-started) page of the Rust language website.You should then have `rustup` and `cargo` available in your terminal. If you want to run on a Raspberry Pi, or via WebAseembly, you will also need `make`.
Follow the instructions on the [Getting Started](https://www.rust-lang.org/learn/get-started) page of the Rust language
website.You should then have `rustup` and `cargo` available in your terminal. If you want to run on a Raspberry Pi, or
via WebAssembly, you will also need `make`.
## Running the game ## Running the game
`cargo run` or `make run`
### Running the game (Raspberry Pi) * For most setups, `cargo run` or `make run`.
`make run-pi` * For the Raspberry Pi: `make run-pi`
### Controls
#### Movement
Any movement commands with numbers can use the top row or numpad.
| Direction | Keys |
|:---------:|-------------------|
| ↑ | ↑, 8, k |
| ↓ | ↓, 2, j |
| ← | ←, 4, h |
| → | →, 6, l |
| ↖ | 7, u, q, Home |
| ↗ | 9, y, w, PageUp |
| ↙ | 1, b, a, End |
| ↘ | 3, n, s, PageDown |
#### Item management
| Key | Action |
|-----|------------------|
| g | Grab an item |
| i | Inventory menu |
| d | Item drop menu |
| r | Remove item menu |
#### Ranged weapons (Not magic or scrolls)
| Key | Action |
|-----|-------------------------|
| v | Cycle potential targets |
| f | Fire at selected target |
#### Other actions
| Key(s) | Action |
|----------|---------------|
| 5, Space | Skip a turn |
| Escape | Save and quit |
#### Mouse controls
By hovering over tiles, the name of item(s) on that tile will appear. For ranged scroll attacks, the left mouse button
is used to select a target.
## WebAssembly Build ## WebAssembly Build
* Install the WebAssembly target via rustup: `rustup target add wasm32-unknown-unknown` * Install the WebAssembly target via rustup: `rustup target add wasm32-unknown-unknown`
* Install `wasm-bindgen`: `cargo install wasm-bindgen-cli` * Install `wasm-bindgen`: `cargo install wasm-bindgen-cli`
* Run `make build-wasm` * Run `make build-wasm`
* Serve the `wasm` folder with a web server (wasm will not work straight from the html file) * Serve the `wasm` folder with a web server (wasm will not work straight from the html file)
## Makefile ## Makefile
If you want to see what else you can run with Makefile, run `make help`. This will list commands and what they do. If you want to see what else you can run with Makefile, run `make help`. This will list commands and what they do.