This course includes:

(updated Jan 2021)

  • 30 hours of on-demand video

  • Downloadable resources and exercises

  • Lifetime access

  • Access on mobile and desktop

  • Certificate of completion

  • 14-day money back guarantee

  • Secure checkout through Credit Card or PayPal

Watch Intro Video

Course Introduction & Learning Outcomes

What you'll learn

These are the topics you'll learn in this course

  • Modern C++

  • SDL for rendering and input

  • Create a small ECS framework to manage game objects

  • Fixed time step game loop

  • Logger

  • Event System

  • Systems for animation, collision, movement, text rendering, projectiles, health, and many more

  • Data-oriented design algorithms and data structures

  • Learn how Dear ImGui is used to create UI tools

  • Learn to embed Lua with C++ and expose scripting power to your engine

Prerequisites

Before taking this course, you must have:

  • A basic knowledge of coding (variables, if-else, loops, functions)

  • Some experience with either Linux, Windows, or macOS

Is this course for you?

If you already know the basics of coding and always wanted to learn C++ and how game engines work under the hood, then this course is for you. We'll start from scratch and create a minimal but functional 2D game engine while learning a large number of important computer science concepts.
Buy $29.99
Is this course for you?

Technologies we'll use and learn

Languages, libraries, and frameworks

In this course we'll use the following technologies:

  • C++ is a powerful compiled language
  • SDL2 is a library for rendering and handling input
  • GLM is a math helper library
  • Dear ImGui is a library to create UI for engine tooling
  • Sol is a binding library for C++ & Lua
  • Lua is fast and easy to use scripting language


ECS

Entity-Component-System

We'll create a small data-oriented ECS framework to manage our game objects in memory while keeping an eye on performance.

Lua Scripting

Learn to embed Lua in your game engine

We'll expose the power of the Lua programming language in our game engine. You'll learn how to use a powerful library called Sol to bind Lua with modern C++. Lua will allow us to customize game objects and script behavior, such as movement, velocity, animation, and much more.

  • Lifetime access

    Join our community and get lifetime access to the course content

  • Access to discussion forum

    Discuss course topics and engage with other students using the discussion board

  • Money back guarantee

    We offer a 14-day money back guarantee for all our courses. No questions asked.

Course Content

  • 2
    Libraries & Dependencies
  • 3
    Displaying the Game Window
    • Game Loop
    • Game Class
    • Creating an SDL Window
    • Polling SDL Events
    • Rendering our SDL Window
    • Fullscreen Window
    • Fake Fullscreen vs. Real Fullscreen
  • 4
    Rendering SDL Objects
    • Drawing an SDL Rectangle
    • Double-Buffered Renderer
    • Loading PNG Textures
    • Quiz: Game Loop & SDL Window
  • 5
    Fixing the Game Time Step
    • Object Movement & Velocity Vectors
    • Capping the Game Framerate
    • SDL Delay
    • Delta Time
    • Uncapped Framerate
    • SDL Delay Accuracy
    • Quiz: Fixed Time Step
  • 6
    Logger
    • Logger Class
    • Exercise: Logging Game Info
    • Logger Class Implementation
    • Popular Logging Libraries
    • Quiz: Logger
  • 7
    Files & Folder Structure
    • Source Subfolders
    • Makefile Variables
  • 8
    Organizing Game Objects
    • Creating C++ Objects
    • Examples of C++ Object Creation
    • Organizing Game Objects
    • Object Inheritance Design
    • Quiz: C++ Objects
  • 9
    ECS Design
    • Component-Based Design
    • Entity-Component-System Design
    • ECS Folder Structure
    • System Component Signature
    • Working with C++ Templates
    • Component Type Template
    • Understanding Component
    • Just a Generic Cup
    • Exercise: System Functions
    • Adding & Removing Entities from Systems
    • The Erase-Remove Idiom
    • Operator Overloading for Entities
    • Quiz: ECS Design
  • 10
    ECS Implementation
    • Component Pool
    • The Pool Class
    • Implementing the Pool Class
    • Registry Systems & Entity Signatures
    • Entity Creation & Management
    • Function Templates to Manage Components
    • Adding Components
    • Function to Add Components
    • Function to Remove Components
    • Templates as Placeholders
    • Implementing System Functions
    • Quiz: ECS Implementation
  • 11
    Creating Entities & Components
    • Creating our First Entity
    • Smart Pointers
    • Converting ECS Code to Smart Pointers
    • SDL Raw Pointers
    • Quiz: Smart Pointers
    • Adding our First Components
    • Warnings Between Int and Size_t
    • Exercise: Entity Class Managing Components
    • Entity Class Managing Components
    • A Warning About Cyclic Dependencies
  • 12
    Creating Systems
    • Movement System
    • Movement System & Delta Time
    • Render System
  • 13
    Managing Assets
    • Managing Game Assets
    • The Asset Store
    • Displaying Textures in our Render System
    • Exercise: Displaying the Tilemap
    • Displaying the Tilemap
    • Rendering Order
    • Sorting Sprites by Z-Index
  • 14
    Animation System
    • Animated Sprites
    • Animation System
    • Identifying Animations by Name
  • 15
    Collision System
    • Entity Collision Check
    • Implementing the Collision System
    • Exercise: Render Collider Rectangle
    • Render Collider Rectangle
    • Quiz: Collision in 2D
  • 16
    Killing Entities
    • Killing Entities & Re-Using IDs
    • Implementing Entity Removal
  • 17
    Event System
    • Introduction to Event Systems
    • Event System Design Options
    • Bat Signal Event
    • Starting to Code the Event System
    • Event Handlers
    • Emitting Events & Subscribing to Events
    • Exercise: Key Pressed Event
    • Implementing the Key Pressed Event
    • Event System Design Patterns
    • Quiz: Event System
  • 18
    Other Useful Components & Systems
    • Keyboard Control System
    • Camera Follow System
    • Sprites with Fixed Position
    • Camera Movement for Colliders
    • Projectile Emitter Component
    • Projectile Texture Inspiration
    • Health Component
    • Projectile Duration
    • Exercise: Shooting Projectiles
    • Shooting Projectiles
    • A Quick Reflection on DRY Code
  • 19
    Tagging & Grouping Entities
    • Tags & Groups
    • Optimizing Access of Tags & Groups
    • Implementing Tags & Groups
    • Projectiles Colliding with Player
    • Projectiles Colliding with Enemies
    • Error Checking and Validation
    • Compilation Time
  • 20
    Data-Oriented Design
    • Data-Oriented Design
    • Avoiding Data Gaps
    • Packed Pool of Components
    • Coding Packed Pools of Data
    • Checking for Null Pool
    • Array of Structs vs. Struct of Arrays
    • Cache Profiling with Valgrind
    • Popular ECS Libraries
  • 21
    Displaying True-Type Fonts
    • Adding Fonts to the Asset Store
    • Render Text System
    • Exercise: Display Health Values
    • Rendering Health Values
  • 22
    Dear ImGui
    • Introduction to Dear ImGui
    • Dear ImGui Demo Window
    • Immediate-Mode GUI Paradigm
    • Render GUI System
    • Button to Spawn Enemies
    • Exercise: Customizing New Enemy
    • Custom Enemy Values with ImGui
  • 23
    Culling & Map Control
    • Killing Entities Outside Map Limits
    • Flipping Sprites on Collision
    • Invisible Entities & Obstacles
    • Careful when Flipping Sprites
    • Exercise: Keep Player Inside the Map
    • Keeping the Player Inside the Map
    • Culling Sprites Outside Camera View
    • Do Not Cull Fixed Sprites
    • Allowing a Margin Around the Map
  • 24
    Lua Scripting
    • Game Scripting
    • The Lua Scripting Language
    • Lua State
    • Reading Lua Tables
    • Fetching Missing Table Values with Sol
    • Lua Functions
    • Level Loader Class
    • Reading Assets from a Lua Table
    • Reading Entities from a Lua Table
    • Handling Multiple Objects in a Lua Level
    • Scripting Night-Day Tilemap
    • Scripting Entity Behavior with Lua
    • Script System
    • Lua Bindings
    • Binding Multiple Lua Functions
    • Loading Different Lua Levels
    • Division of C++ & Lua Code
  • 25
    Next Steps
    • Next Steps
  • 26
    Bonus: The Map Editor
    • Final Project: Creating a Tilemap Editor
  • 27
    Moving Forward
    • Copyright & Content Distribution
    • Similar Courses

FAQ

  • Will this course work for any operating system?

    The code we'll create works for Linux, Windows, Unix (BSD), macOS, and even RaspberryPi.

  • What if I don't know C++?

    Not a problem. Many students come from different languages, like Python, C#, JavaScript, etc. A basic understanding of coding in any language is enough for you to follow along. We'll learn the ins and outs of C++ together.

  • What if I have any issues or questions?

    Each lecture has a discussion board, where you can ask other students for help. You will also be able to engage with others by answering their questions.

Instructor

  • Gustavo Pezzi

    Senior Lecturer

    Gustavo Pezzi

    Gustavo teaches computer science and mathematics at BPP University, London. He studies how teaching game programming can help enhance awareness and understanding of basic mathematics and physics. He is also a professional software engineer with more than 10 years of experience, with an industry background in 3D systems, games, systems, databases, and data analysis. His academic path includes institutions such as Pittsburg State University, City University of London, and University of Oxford.

Reviews

See what students are saying

  • Absolutely phenomenal course!

    Dylan Bennett

    This was one of the best online courses I've done in a *long* time. The progression of topics is extremely smooth and well-thought-out. The depth that each t...

    Read More

    This was one of the best online courses I've done in a *long* time. The progression of topics is extremely smooth and well-thought-out. The depth that each topic covered is just right so as not to overwhelm you, but also not leave you in confusion as to what exactly you are doing. You finish the course with a sense of skill, empowerment, and inspiration, rather than feeling like you only have the know-how to implement *exactly* what was covered in this course and no more. It's the mark of truly good educational materials. I already had a fair amount of coding experience in languages such as C#, Python, and Lua, but almost zero experience with C++. This course was perfectly pitched to my level of experience. It didn't try to go through extremely tedious explanations of basic programming concepts, but rather it respected my time and existing knowledge and gave me the information I needed to understand what we were doing in C++. There were also plenty of times where fundamental C++ concepts were repeated so as to really drill them in for people inexperienced with C++, and I really appreciated that. Another thing I loved was that the instructor is writing all the code alongside you from scratch. Every file starts out blank and is filled character by character, line by line, as you build up the code. Sometimes intentional directions are taken that have to be back-tracked and changed or fixed, but it's not because of incompetence or bad planning in the course, but rather to give you a further understanding of *why* you are doing something, not just blindly following along with what's being typed. And to top it off, all the code is being written in a visually bare-bones text editor (vim), which means that the focus is on the *code*, not a fancy IDE and all its bells and whistles being a distraction. This is more important than it sounds. (This doesn't mean *you* have to use vim, of course, but having the code written this way by the instructor is very powerful for keeping the focus on the code you are writing.) Only a couple times toward the very end of the course is there code for a lesson already written, but by that point it's appreciated and it's actually a respect of your time. Lastly, the number of powerful concepts packed into this course is just gold. I mean it. It's astonishing that this one course delivers all that in a streamlined, easy-to-understand, easy-to-follow set of steps. You could easily have an entire course on just using SDL, or just how the Entity-Component-System architecture works, or how to embed Lua into your C++ program. On top of that, it would have been so easy for this course to be just a messy jumble of those concepts all crammed in together, with no real separation of ideas. Instead, this is laid out in such a way that each topic is approached smoothly and in a way where you feel like you have a solid grasp of it before moving on to the next topic. I am an educator myself and have written my own coding courses for all ages and experience levels. I recognize the monumental amount of work that has gone into making this course what it is. Trust me, you don't want to pass this one over. It is well worth the money. Thank you very much for creating this course! My head is bursting with ideas for so many new projects directly as a result of what I got out of this course.

    Read Less
  • The Best Course I've Ever Taken!

    Javid Gajievi

    Thank you Gustavo Pezzi! While learning game programming, I also gained deep insight into C++ and Game Development. I am very much excited to see more fr...

    Read More

    Thank you Gustavo Pezzi! While learning game programming, I also gained deep insight into C++ and Game Development. I am very much excited to see more from Gustavo!

    Read Less
  • An amazing course by an amazing teacher

    Σπύρος Μιλτιάδους

    Thanks for carefully designing the course its one of the best resources out there.

    Thanks for carefully designing the course its one of the best resources out there.

    Read Less