Learning C++ by Building Games, Second Edition — book cover
✓ Free online edition

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.

36 Chapters SDL 3 C++20 AI-assisted

The Kindle edition has every chapter; the paperback has the core course.

36chapters, free online
25projects, code on GitHub
200+diagrams & screenshots
£0no sign-up, no paywall

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

Bouncing Ball Square Invader Cascade Arcade Shooter Whack-a-Mole Click Particle Particle Fountain Loot Grid The Runner Animated Character Vibe Snake Vibe Asteroids Rogue SDL (7 parts)

Contents

Act 1 — The Foundations
Act 2 — Bigger Programs
Act 3 — Object-Oriented C++
Part 4 — The Wider World & AI
Final Project — Rogue SDL
Appendices

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 →