
Learn to build 2D arcade games from scratch in C++ using object oriented programming, SDL, and modern C++ features, including breakout and Pacman clones, plus Tetris and Asteroids challenges.
Explore advanced C++ concepts such as classes, object-oriented programming, and inheritance; choose between theory sections or practical 'let's make a thing' projects from vectors to Pacman, with downloadable source code.
Practice making things from scratch to reveal the gory details, solve hard problems, and build intuition for baseline systems behind game engines like Unity in C++ programming.
Remember that classes and objects are tools we use to solve problems. Choose light abstractions with tradeoffs in mind, and avoid unnecessary class hierarchies when using engines like Unity.
Explore top down and bottom up design by contrasting high level problem abstraction with concrete components, then mix approaches using classes and objects to build game projects.
Explore C++ classes as blueprints that encapsulate data and functions, using a 2D point example to show data members, set and display methods, and public/private access.
Explore encapsulation by using public interfaces and private implementation to hide internals, exposing only set and display, and learn how changes to implementation won’t affect external code.
Prioritize data members as the class’s internal representation to guide size and behavior. Prefix them with m to distinguish from parameters and locals.
Explore how class data is manipulated by member methods, including public versus private access, method declarations and implementations, and using the scope resolution operator for correct binding.
See how structs and classes in C++ are similar, with default public access in structs and private in classes, affecting access to methods and data members.
Learn how initializer lists set x and y before the constructor body, with order determined by member declaration. Preferring initializer lists avoids bugs and improves initialization reliability.
Explore delegating constructors in c++11, where a constructor calls another to initialize data members with default values. See how the default constructor delegates to the parameterized constructor to simplify code.
Learn how to initialize a reference member in a class using an initializer list, binding the reference to A at construction time instead of in the constructor body.
Learn how explicit constructors disable implicit conversions in the string class, preventing char-to-string conversions and guiding the compiler to pick the best constructor match.
Learn how to call methods on objects in C++ using the dot and arrow operators, and how new creates objects and selects constructors.
Explore how objects within objects interact in C++, showing how class A containing B requires explicit initialization when B has no default constructor, highlighting cross-cutting concerns.
Discover how a parameterized class B cannot populate a five-element array without a default constructor; contrast with vectors, which do not auto-create objects.
Explore how the copy constructor automatically copies an object's int and float members when passing by value, and when you might need to define one for resource management.
Learn how the static keyword in C++ makes class data members shared by all objects, initialized with the scope resolution operator, and how static methods access only static data.
Learn how to use const in classes, including const data members initialized in the initialization list and const member functions, and when to apply mutable.
Learn how inline functions insert code directly to boost performance, when to declare them in headers, and how the compiler treats inlining as a hint rather than a guarantee.
Learn to compare two student objects by implementing an equals method and overloading the operator double equals, using operator overloading sparingly.
Explore building a 2d vector class and learn how operator overloading integrates with vector math, including a zero vector, constructors, and accessors for x and y.
Explore how the friend keyword lets the insertion operator access private members for debugging vectors. Implement the insertion operator with ostream, returning ostream& for chaining outside the class.
Learn how friend classes can access another class's private members, enabling direct modification while highlighting encapsulation breach; this technique is rare and often avoided.
Learn how to compare floating point numbers using a tolerance value to account for limited precision, and implement equality, inequality, and relational operators in a vector class with epsilon-based checks.
Negating a vector in C++ involves returning a new vector with each component negated, explained mathematically and geometrically, implemented via a unitary operator overloading that does not modify the original.
Learn to multiply a vector by a scalar to scale it, including negative values, and overload times and divide operators with a friend function for scalar-first use.
Compute vector addition and subtraction by adding or subtracting components using the head-to-tail method, and implement operator overloads for 2d vectors in code.
Learn to compute a vector's magnitude from its x and y components using the Pythagorean theorem. Explore square magnitude and magnitude with square roots and two magnitude variants for vectors.
Explore unit vectors on the unit circle, learn to compute magnitude, and implement get unit vector and normalize functions to produce unit-length vectors with epsilon safeguards.
Learn how the dot product projects B onto a unit vector U, giving the projection length and shadow direction, then decompose B into parallel and perpendicular components.
Relate the dot product to the angle between two vectors using cosine, convert vectors to unit length, and compute the angle via arc cosine in a C++ function.
Reflect a velocity off a surface by projecting onto the normal and applying the two times the dot product with the normal to obtain the reflection.
Master rotating a point in 2d space using a rotation matrix, cosine and sine, to move coordinates around the origin and around any point by translating, rotating, and translating back.
Explore dynamic memory in classes, emphasizing responsibilities beyond constructor and destructor, and learn using the standard library to manage allocation, with plans for move semantics examples later.
Explains shallow vs deep copy in a dynamic array class, showing that by-value copying shares memory, and advocates a deep copy via a copy constructor and init function.
Learn how to implement the assignment operator for a dynamic array in C++, including a self-assignment check, deleting old memory, and returning a reference to the object.
Implement the destructor to free the dynamic array with delete[] and reset the data pointer to nullptr, preventing memory corruption and dangling pointers as the object goes out of scope.
Explore how new and delete manage object lifetimes, including dynamic memory for arrays, and default constructor invocation on allocation, plus destructor cleanup on deletion.
Explore completing a dynamic int array: manage capacity with a resize multiplier, implement push back, reserve, resize, and safe memory handling with destructor, copy constructor, and assignment operator.
Set up the sdl2 framework in a mingw c++ project, configure iso c++11, link the sdl2 libraries, and prepare include and lib folders and an assets folder.
Initialize SDL with video support, create a centered window using screen width and height, and run an event loop that processes quit events and cleans up with SDL_DestroyWindow and SDL_Quit.
Learn to use an SDL surface as a 2D pixel canvas, implement set pixel and get index, lock and unlock the surface, and draw a red dot at the center.
Explore how SDL reports a surface's pixel format and why formats vary by system, including ARGB and RGBA eight-bit channels. Learn to avoid hard coding color values for cross-platform graphics.
Build a 32-bit color class to replace hard-coded colors, with constructors, RGBA channels, and SDL map and get helpers, while organizing code in a graphics folder and using forward declarations.
Learn how a screen buffer class wraps an SDL surface to enable double buffering, with init, clear, set pixel, copy, and assignment operations.
Apply Bresenham's line algorithm to decide which pixels light up along a line, using a decision parameter to pick lower or upper pixels and avoid floating point math.
Learn to draw a line on screen using a line-to-d approach, implementing a two-case algorithm with a decision parameter and integer rounding to handle x-major and y-major steps.
Explore when to use is a relationship versus has a relationship to guide inheritance, showing how data overlap dictates modeling as a specialized version of a generic parent.
Understand how a derived class inherits the base class's public data and methods, while constructors and destructors are not inherited, shaping access through public encapsulation in C++.
Explain how the protected keyword lets derived classes access base class members while keeping them hidden from outsiders, unlike private.
Learn how static binding selects the correct print function at compile time, and how virtual functions enable dynamic binding and polymorphism when treating derived objects as base types.
Override class B's print to replace class A's version, using the override keyword for clear intent and to let the compiler flag non virtual member function marked as override.
Call base class methods in C++ with the scope resolution operator to access the base version from a derived class and prevent infinite recursion for methods, members, constructors, and operators.
explain how inheritance complicates dynamic memory, showing a base class with a destructor and a derived class that allocates heap memory, and why a virtual destructor enables correct cleanup.
Explore how inheritance and virtual functions enable polymorphism in C++. Learn that pure virtual functions create abstract base classes that cannot be instantiated and require derived classes to implement them.
Examine abstract base classes in C++, focusing on pure virtual methods and why they cannot be instantiated. Derived classes must implement the do something method, enabling instantiation of non-abstract subclasses.
Explore pure virtual classes as interfaces that abstract platform-specific rendering details behind a common interface. Learn that interfaces cannot be instantiated; derived classes must implement all methods.
Explore how a class can inherit from multiple types, with C deriving from A and B so C is both an A and a B, then note keeping interfaces simple.
Explore the pitfalls of multiple inheritance where D inherits from B and C, yielding two copies of A's print and ambiguity; virtual inheritance resolves it, yet avoidance is advised.
Examine protected and private inheritance in C++, showing how public members become protected in derived classes, how internal calls work, and when non-public inheritance can be useful.
An in depth practical course on OOP using C++. We learn the very basics of OOP like Classes and Objects up to more advanced topics like move semantics and lambda expressions. We then take those topics and apply them through a complex application that will contain 4 different arcade games: Tetris, Break-out!, Asteroids and Pacman. We will code 2 of those games together using the techniques we learned in the previous sections. The other 2 games will be projects for students.
We'll be making this arcade app from SCRATCH (mostly), using SDL for window management, input and colour but that's it! Everything else will be hand coded by us so we can get a good understanding of what's happening underneath the hood in game engines.
What we make from scratch:
Drawing lines and shapes
Vectors
Polygon fill algorithm
2D texturing
2D sprite animations
2D rotations
Loading bitmap files
Sprite sheets
So much more!
This is an exciting course for students to take their skills to the next level through challenging problems and games. This is a HARD course, but if you stick with it (and finish all the exercises and projects), you'll not only be a better programmer than most of your peers, you'll be one step closer to getting that industry job you've been dreaming about.
There’s no risk!
This course comes with a full 30 day money-back guarantee. If you are not completely satisfied with the course, Udemy will refund you what you paid - no questions asked.
Register for the course today!