Learning C++ by Building Games
From your first line of code to a roguelike you built yourself. The complete second edition — free to read online.
The Kindle edition has every chapter; the paperback has the core course.
Never written a line of code? Start here. C++ has a reputation for being hard, usually because it's taught in the abstract — this book does the opposite. Every idea arrives because a game needs it, and you build every game step by step, with the code explained as you go. By the end you'll have written modern C++20 and built a roguelike of your own. This whole second edition is free to read online; it's also the complete companion to the print and Kindle editions.
What you'll build
Contents
- 1Setting Up Visual Studio 2026 & SDL 3
- 2Variables & Structs
- 3Bouncing Ball Project
- 4Controlling the Flow of the Code
- 5Square Invader Project
- 6Loops
- 7Cascade Project
- 8Functions
- 9Act 1 Capstone Shooter Project
- 10Pointers, Smart Pointers & References
- 11Whack-a-Mole Project New
- 12Click Particle Project
- 13Arrays & Vectors
- 14Particle Fountain Project
- 15Maps & Other Collections
- 16Loot Grid Project
- 17The Runner Project New
- 24The C++ Wilderness
- 25AI-Assisted Programming Principles
- 26Vibe Snake Project
- 27Vibe Asteroids Project
- 28The Component Pattern
- 29The Data Locality Pattern
- 30Part 1 — A Grid of Characters Project
- 31Part 2 — Dungeons in the Dark Project
- 32Part 3 — Monsters and Treasure Project
- 33Part 4 — Hunters and Save Files Project New
- 34Part 5 — Sound and Light Project New
- 35Part 6 — States and Scrolls Project New
- 36Part 7 — Swords and Fireballs Project New
Carry on in the series
Fundamentals →
The math every engine hides — vectors, physics, pathfinding and a software 3D renderer, built from scratch.
Using C++ to Build a Traditional Roguelike →
Rogue SDL was a taste. This is the whole meal — a complete dungeon crawler, built properly.
Building C++ Games with AI →
You bring the vision, the AI writes the C++, and you direct it all the way to finished.
Want the story behind the book? About this book →
