Complete Roguelike Tutorial, using Rust + tcod
This is a port of the (in)famous Python+libtcod tutorial:
The code is all implemented but we plan to clean it up in a few places before splitting it into parts and writing the tutorial text.
The text is in the
doc directory, you can look at the rendered tutorial at:
Running the tutorial code
If you want to try running a part of the tutorial using the reference code here, all you have to do is run this cargo command:
cargo run --bin name-of-part
For example, if you would like to run the reference code that is at the end of Part 1 then you run this command:
cargo run --bin part-1b-movement
The Rust source files in
src/bin/.rs are all auto-generated from the tutorial pages themselves.
The single source of truth for both the code and the final pages is in
If you want to make changes to the Rust files, you need to edit the corresponding pages in
Note that since the code can be laid out in a different order than the tutorial, this involves a little bit of digging.
You can check the
doc/rs/*.adoc files for how is each final Rust file constructed from the tutorial snippets.
Building the Rust files
First, you need to have Asciidoctor installed.
Next, after making some changes to the files under the
doc directory, run the following:
make clean docs
This will generate the HTML tutorial as well as the corresponding Rust files in the
You can preview them there and verify that everything looks correct.
Updating the generated files in
Run the following command:
It will regenerate the documents and copy the Rust files into
src/bin matches the source documents
This will build the documents and diff them against the versions in
They should match.
Make sure you build build the documents, with no leftovers files and update the
make clean docs update-cargo-bin
Before opening a pull request, make sure that
make diff-rust ends up empty.
The tutorial is more or less finished: all the chapters have been written.
You can follow them and build your own roguelike.
You can also check out this repository and run for example
cargo run --example part-13-adventure-gear to play the final version (or any of the previous ones).
There are of course things that could use updating, such as the language and general flow of the text.
The structure of the tutorial itself could use some cleaning up too and some e.g. the
rand crate we use is wildly out of date.
Finally, there are improvements and fixes that could be done in the
tcod-rs crate this tutorial is based on.
For more suggestions, check out the Issues section.
However, the original author has moved on to other things and no one else has volunteered to take over the maintenance of this repository.
Issues and pull requests will not be ignored, but it can take weeks before you get a reply. And anything involving more than a minimal time investment will likely take even longer.
If you do wish to help out with the maintenance, please open an issue or send en email to <firstname.lastname@example.org>.