Learn Rust / Build something real
Rustbound
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
- 16 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.
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.
01 / Make the rules work
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.
02 / Give the world a shape
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.
03 / Make decisions matter
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.
04 / Build the engine
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.
- Closing the Terminal Is Not Game Over.Teach a Rust idle game to save itself as JSON and load itself back. Add your first dependency with serde, and let Result handle a save that will not load.
05 / Cross into the browser
JavaScript Does Not Get the Rules.Compile a Rust idle-game engine to WebAssembly, give JavaScript a small adapter instead of the rules, and run the same tested game in a browser.- A Button Is Not a Rule.Build one Web Component that draws the Rust engine, turns clicks into game.click(), keeps time, and saves progress in the browser.
- Localhost Is Not a Launch.Turn Rustbound Idle into a five-file release build, test the exact folder that ships, and deploy the WebAssembly game as a Render static site.
- A Bookmark Is Not an App.Turn Rustbound Idle into an installable Progressive Web App that opens without a network, saves when hidden, and proves its offline release in a real browser.
- Cheaters Are Going to Cheat.Validate edited Rust game saves, repair values the rules already know, reject impossible state, and admit what client-side code cannot prevent.
06 / Build what comes next
The Tutorial Is Not the Game.Turn a finished Rust tutorial into a welcoming open-source project, then take one small contribution from idea to pull request.