Learning C++ by Building Games: Learn C++ from Scratch & Build Games using SDL 3 and AI

Learning C++ by Building Games: Learn C++ from Scratch & Build Games using SDL 3 and AI book cover

Learning C++ by Building Games: Learn C++ from Scratch & Build Games using SDL 3 and AI

Author(s): John Horton (Author)

  • Publisher: Independently published
  • Publication Date: 27 May 2026
  • Language: English
  • Print length: 427 pages
  • ISBN-10: B0H376GKW9
  • ISBN-13: 9798198908499

Book Description

If you’ve never written a line of code in your life, you’re in exactly the right place. If you already know some C++ but want to start building games, you’re also in the right place.

C++ has a reputation for being difficult to learn. Usually that’s because it’s taught in the abstract — syntax first, real programs later. This book takes the opposite approach.

Every concept is introduced because a game needs it.

You will write real, running programs from the very first chapters:

  • a bouncing ball
  • a single Space Invader enemy
  • particle systems
  • animated characters
  • arcade shooters
  • Snake
  • Asteroids
  • and finally a complete top-down roguelike with procedural dungeon generation, enemies, pickups, combat, and game systems built across multiple chapters

By the end of the book, you will understand modern C++ well enough to design and build complete 2D games of your own.

What makes this book different

This is not a book full of disconnected syntax examples. Every theory chapter is followed by a complete SDL 3 project that immediately puts the ideas into practice. You do not spend hundreds of pages waiting to build something interesting — you build continuously from the beginning.

The book is organized into three acts and a final project across 30 chapters.

Act 1 — The Foundations

Learn the core language through practical game projects: variables and structs, flow control, loops, and functions. Act 1 ends with a complete shooter featuring player movement, enemy pools, lasers, collision detection, scoring, lives, and a restart/game-over system.

Act 2 — Building Bigger

Learn how larger C++ programs are structured: pointers and smart pointers, vectors and containers, classes and object-oriented programming, and inheritance and polymorphism. Projects include particle systems, loot grids, animated characters, and progressively evolving game architectures.

Act 3 — The Wider World

Explore the broader C++ ecosystem, AI-assisted development, and professional game programming patterns. You will also build Snake, Asteroids, AI-assisted prototype projects, component-based systems, and the data-locality driven designs used in real engines.

Final Project — A Complete Roguelike

The final chapters combine everything from the book into a complete SDL 3 roguelike, developed step-by-step across three chapters: procedural dungeon generation, monsters and combat, pickups and progression, and turn-based gameplay systems. All major projects include complete working source code.

AI-assisted programming, taught carefully

Every chapter includes an AI exercise. These are not prompts to blindly generate code — they teach you to read AI-generated code critically, understand every line, identify mistakes, and use AI tools responsibly as part of a real development workflow. Learning to work effectively with AI is a skill, and this book treats it as one.

Who this book is for

  • complete beginners with no prior programming experience
  • programmers coming from other languages
  • aspiring indie game developers
  • anyone who wants to learn modern C++ by building real projects instead of isolated exercises

Technical details

  • Modern C++ (C++17 and later)
  • SDL 3
  • Visual Studio 2026 Community Edition setup covered step-by-step
  • Windows-focused, with SDL 3 cross-platform concepts throughout
  • 30 chapters across three acts and a final project
  • Complete working source code included in text and on GitHub

View on Amazon

电子书代发PDF格式价格30元我要求助
未经允许不得转载:Wow! eBook » Learning C++ by Building Games: Learn C++ from Scratch & Build Games using SDL 3 and AI