[][src]Crate rust_warrior

rust-warrior

A textual turn-based AI game for learning Rust, based on Ruby Warrior.

You will progress through levels controlling the Warrior, by deciding which action to take based on the surroundings. These decisions will be defined with Rust code in the play_turn method of Player.

A Note About Rust vs Ruby

There are some notable differences between this game and Ruby Warrior. Since Ruby is an interpreted language, Ruby Warrior is played by interacting with a player.rb script which controls the warrior. The rubywarrior command then leverages the Ruby interpreter to run that script. In the Rust version, you will generate a Rust project which includes rust-warrior as a dependency in its Cargo.toml file. The Game is then imported. To run it, you simply use cargo run like in any other Rust project.

The Game Engine

The game engine uses the specs (Specs Parallel ECS) crate, which is an ECS library. This might be a familiar tool for game developers. It will hopefully increase the quality of the game's implementation (and possibly allow for an easier transition to an Amethyst version at some point).

Re-exports

pub use game::Game;
pub use player::Player;
pub use warrior::Warrior;

Modules

actions

actions the player can instruct the Warrior to take

engine

ECS-based game engine

floor

contains types that represent the topology of a level

game

where it all starts

player

contains the trait exposed to the player for controlling the Warrior

profile

contains the struct for saving player name and current level

starter

contains some methods for generating the game files

ui

contains some helper functions for prompting input from the player

unit

contains types that represent units that appear in the game

warrior

contains the interface exposed to the player for controlling the Warrior