Rustbound

Learn Rust / Build something real
Small function.
Bigger game.
A game is a collection of small systems working together. Build them in Rust, from your first damage function to a dependable game core.
- Rust
- Game systems
- 9 published lessons
THE RUSTBOUND CORE
Optional: turn on reading history further down this page, then mark lessons complete to earn XP and charge the core. Nothing is guessed from visits.
main.rs / The first moving part
fn click_damage(base: u32, bonus: u32) -> u32 {
base.saturating_add(bonus)
}
The mission log
Build on what you learned. Each lesson adds another working piece to the game.
- Skip Hello World.Learn Rust by building real game logic instead of stopping at Hello World. Write and test three small functions for damage, health, and enemy defeat.
- One Attack Is Not a Fight.Learn Rust by turning small functions into a combat loop. Build an attack() function, use mut and while, and create your first real game mechanic.
- Three Numbers Are Not a Player.When your attack takes three loose u32 values, Rust has no idea which belong to the player. Learn how structs give your game data a name and a shape.
- Borrowing Without the Lecture.Learn Rust ownership and borrowing by fixing three real compiler errors. Let a player attack an enemy with &Player and &mut Enemy, without a lecture.
- One Fight Is Not a Game.Learn Rust impl blocks and methods by giving your idle game one Game struct, tougher enemies by stage, and a game.click() that runs a full turn.
- Winning Is Not Progress.Learn Rust by making winning pay. Add gold, XP, and levels to an idle game, level up with a while loop, and calculate damage with a &self method.
- False Is Not an Answer.Our player has ninety-six gold and nothing to buy. Build a shop in Rust, then replace a vague true or false with an enum and let match handle every outcome.
- Idle Is Not a Timer.Make your Rust idle game progress while you are away. Add tick(seconds), a for loop, and tests that run an hour of game time instantly.
- We Accidentally Built a Game Engine.Split a Rust game into modules and a library crate, step by step, with tests passing after every move. Learn mod, pub, and pub use.