
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.
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 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 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 explicit constructors disable implicit conversions in the string class, preventing char-to-string conversions and guiding the compiler to pick the best constructor match.
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 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.
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 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.
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.
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.
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.
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.
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.
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.
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!