
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Install Visual Studio Community 2022 for C++ development, choose desktop development with C++, and explore optional Unreal Engine and Unity integrations, downloadable from Microsoft.com.
Create a new C++ project in Visual Studio 2022 by selecting an empty project template and a separate solution to host multiple C++ projects for Windows development.
Explore the Visual Studio interface, including the menu bar, solution explorer, output window, git and version control, and toolbars, and learn to manage projects, files, and docking for efficient coding.
Create a new C++ source file named main, write int main with include iostream, and output hello world using std::cout and the insertion operator, and run to see the console.
Download and install JetBrains Sea Lion on Windows, set the bin path, reboot, and configure file associations for CLion; Visual Studio offers an alternative workflow.
Create a new CLion C++ executable, explore CMake and MinGW defaults, view the hello world boilerplate, and compare Visual Studio workflow.
Modify your ide to improve readability by increasing the interface and font size in sea lion with alt shift plus, and set c++17 as the language standard in visual studio.
Declare and initialize a std::string variable message with hello world, replace a hard-coded string in cout, and learn to run with an external console and optional cin input.
Explore common data types in C++ including integers, floats, doubles, characters, booleans, and strings, and learn how to declare, output, and transform these values, including true/false and case distinctions.
Learn to use comments in code, including single-line and multi-line formats, for debugging and task lists, and emphasize readable, self-explanatory code that speaks for itself.
Learn to format outputs in C++ by using the insertion operator with cout, std::endl, and backslash n to create clean, multi-line messages from strings and variables, with spaces between objects.
Explore how to craft a creative C++ output in a main function by using hero name, age, power, treasure, and rank, with the insertion operator and data types.
declare and initialize a string array named messages, a collection of data holding three items, using curly braces and commas, and access each element by its index.
Access array elements by index using square brackets, starting at zero, and understand static arrays with fixed size, out of bounds errors, and how to extend them before runtime.
Modify a fixed-size array in C++ by indexing and assigning new values, such as hello learner at index zero, and learn initialization to avoid garbage data.
Learn to determine an array size with the size of operator. Divide total bytes by type size to find the element count for char, bool, int, float, double, and string.
Practice building a game character in c++ by defining name, class, and gold, managing a five-item string inventory (bow, arrows, health potion, map, torch), and displaying with zero-based indexing.
Declare and initialize a dynamic vector in C++ using std::vector<int> IDs. Vectors grow and shrink at runtime, unlike static arrays, and are initialized with curly braces and the = operator.
Access vectors in c++ using cout to display elements and practice front, back, and at for first, last, and middle values such as 10, 60, and 40.
Learn how to modify a vector in C++ by pushing back values, inserting at front or specific positions using begin, end, and iterators, and erasing elements during runtime.
Learn to get the size of a vector in C++ with vector.size(), see how size changes when erasing, and note basic vector operations like resize.
Learn to manage a game inventory in C++ with a std::vector of strings, add items with push_back, and display first, last, and middle items using front, back, and at.
Declare an associative map type using the standard library, with string keys and integer values, as demonstrated by the gamertags example.
Learn to access map types by key to retrieve values, contrasting with vectors, and check key existence with find and end to avoid default values from misspelled keys.
Learn how maps automatically sort by key, then insert a Neon Warden with id 1213, erase an entry, and clear the map during pagination while tracking the map size.
Use a standard map with string keys and int values to store RPG character stats (health, mana, strength, agility, intelligence) and print them via key-based access with the insertion operator.
Explore arithmetic operators in c++ for transforming data, including plus, minus, multiply, divide, and modulo, and learn practical uses like even/odd checks, cycling through ranges, and array indexing.
Learn assignment operators in C++ for game development, including simple equals and compound forms like plus equals, minus equals, times equals, divide equals, and modulo equals.
Learn how the increment and decrement operators work, including pre and post forms, with examples using cout and int variables, and how they behave in loops.
Learn how C++ comparison operators return boolean results using ==, !=, <, >, <=, and >=, and apply them in if statements and cout outputs.
Learn how logical operators and, or, and not combine boolean expressions in C++ to evaluate conditions, with examples using a < b and a != b, and understand short-circuit behavior.
Explore operator precedence and order of operations, from parentheses to multiplication, division, modulo, and addition and subtraction, evaluated left to right. See how integers and floats affect results through casting.
Learn the basics of getting user input in c++, using cin and the extraction operator, store input in age, prompt with instructions, and echo back your age as feedback.
Learn how to handle invalid input in c++, using std::cin.clear and std::cin.ignore to reset the input stream and let the program continue.
Learn to combine multiple inputs in C++ by using getline to read a full name with spaces, and include the string library for proper functionality.
Declare string variables for name, place, object, adjective, verb, and number; collect user input with getline; assemble and print a dynamic ad lib story in C++ for game development.
Master conditional branching in C++ by using if, else if, and else to evaluate age-based conditions and drive messages, with examples of input and comparisons.
Explore using logical operators with if statements in C++, including and, or, not, and null checks, with age examples to show how conditions evaluate.
Learn to use a for loop to repeat code while a condition holds, with an initializer, a condition, and an updater, cycling from zero to nine.
Explore variations of a for loop, including counting up and counting down, and the impact of different initializations and conditions. Learn how to avoid infinite loops.
discover how to iterate through an array in c++ using a for loop, with the initializer, condition, and iterator advancing the index.
Master for loops in c++ for game development by using break to exit early, continue to skip items, and apply modulo to filter even or odd numbers.
Explains fixing off by one errors in for loops by calculating array length (size of numbers divided by size of int), avoiding <=, and embracing for range.
Learn how to use range-based for loops in c++, replacing off-by-one errors with foreach-style iteration. Note c++17 limits and c++20 enhancements for forward and backward iteration, including begin and rend.
Explore for loops with vectors in c++, including iterator and range-based approaches. Learn to iterate forward and backward, manage size-based indexing, and compare vectors with arrays for looping.
Explore traversing vectors and arrays with iterators, including begin, end, reverse iterators, and rbegin/rend. Compare for loops, auto, and C++17/20 approaches for forward and backward traversal.
Apply for loops in c++ to generate number sequences: count up from 1 to a user-defined limit, print even numbers by twos, and count down from the limit to 1.
Explore how the while loop uses a condition in parentheses, contrasts with a for loop, and waits for user input, exiting when the condition becomes false to avoid infinite loops.
Learn how to use the do while loop to ensure it runs at least once, prompt for a number between 1 and 100, validate input, and loop on invalid entries.
Review a C++ number guessing game solution using a constant secret number and input validation for 1 to 10, with a do-while loop repeating until the guess matches.
Learn to replace long chains of if statements with switch statements in C++, using case labels, default handling, break to control flow, and cin/cout for user input and output.
Explore the enum type in C++: a user defined type with named integer values, defaulting to zero through three, assignable values, and use in switch statements.
Master casting types in c++ for games, using static_cast to convert integers to enums, handle floats, and recognize when casting to strings is not possible.
Explore strongly typed enum types using a scoped enum class to safely represent students like Josh, John, Mary, and Alan, accessed with double colon in a switch to handle cases and defaults.
Define a battle action enum with attack, defend, magic, item, and run; display battle menu, cast the choice to the enum, and handle it with a switch and do-while loop.
Define and call functions in C++, organizing code and enabling reuse by encapsulating logic, handling parameters and return types, and printing hello world inside the function.
Learn how to pass arguments to a function in C++, using a string parameter like message, printing it for debugging, and handling multiple comma separated parameters with the signature.
Learn to return values from C++ functions, switch from void to int with the return keyword, pass parameters, and add two numbers before storing and printing the result.
Call a function from another function to reuse code, define void say hello, pass parameters, and invoke add to output results like 60.
Learn how function declaration order affects calls in C++. Place declarations above main to ensure functions are found and called correctly, preventing lookup issues when declaring after main.
Define a function that returns a std::vector<int> of random numbers, fills it with rand values using push_back and a seed, then prints them in main.
Explore passing by value and by reference in c++, comparing memory use and performance while sorting a vector of random integers with the standard sort, and using ampersand references.
Learn to use templates in c++ by turning print_message into a generic function that accepts any type with a parameter T. It prints values directly without converting to strings.
Learn how to use templates to sort vectors of any type with a generic sort function using a template parameter T, and apply it to string vectors.
Explore variadic templates in C++, expanding a parameter pack with ellipses. Use a print message function with cout to output strings and numbers like hello and 42 gold.
Use templates to implement damage calculation, health restoration, and critical hit logic with a generic type T. Learn auto type deduction and a ternary operator to print combat results.
Explore the pre-processing stage of the C++ build process, learn how the preprocessor handles directives like include, define, and ifdef, defines macros, and enables conditional compilation across multiple operating systems.
Learn how the C++ build process moves from pre-processed code to assembly during compilation, generates object files, and how the assembler converts to binary before linking libraries.
Explore the linking and execution stages of C++ builds, where the linker combines object files with external libraries to produce an executable, resolves symbols, and addresses runtime errors.
Learn how to use forward declarations to access functions across source files, organizing code with a utilities module, and avoid unnecessary dependencies while sharing generate random numbers and vector operations.
Explore how header files declare functions, classes, and constants for reuse across cpp files, using extensions .h or .hpp, and how this supports code organization, encapsulation, and avoids duplication.
Learn how to create header files with include guards, choose between ifndef and pragma once, and manage declarations, definitions, and templates to build C++ projects for game development.
learn how to clean up template definitions with inline files (.inl), place definitions in inlines while keeping declarations in headers, and manage includes for clean, centralized code.
Learn to create a new library project in CLion, convert an executable into a library, configure C++17, organize sources and headers into include and source folders, and relink projects.
Convert a basic cmake project into a static library by updating cmakelists.txt, replacing the main executable with a library target, configuring include directories, and syncing changes.
Learn how to link a library to a C++ project by configuring include directories, locating the utilities library, and using target_link_libraries to build and run a hello world program.
Learn to create a utilities library project in Visual Studio by structuring include and source folders, adding a utilities project, configuring startup project, and reorganizing files within the solution.
Convert the utilities project into a static library in Visual Studio, configure for C++17, set include directories, and plan to link it with other project components.
Learn to link a static library to a C++ project in Visual Studio by configuring the linker inputs, include directories, and build order to resolve library dependencies.
Learn to convert a static library to a shared library using CMake, install the dll and headers, and configure target include directories for multi-project use.
Learn to package and integrate an external C++ library by organizing lib, dll, and include files, updating CMake with extern utilities, and linking via relative paths for cross-project use.
Learn to integrate an external library in Visual Studio by configuring includes, linking the library, and validating a build with C++17 settings.
Learn to access memory addresses by visualizing memory as boxes with unique hexadecimal addresses, and use the address-of operator (&) to obtain a variable's location.
Explore how references act as aliases to variables, sharing the same memory address, and learn why passing by reference lets functions modify the original data rather than using copies.
Discover the limitations of using references, including how a reference binds to a single memory address and cannot be reassigned, and why pointers address this behavior.
Declare an int pointer, use the dereference operator to hold a memory address, name it as p, assign it the address of a variable, and print the address with cout.
Learn to dereference pointers to access data at a memory address using the dereferencing operator to output the treasure location and amount, and reassign pointers to new addresses.
Build a C++ potion system with an enum of potion types, a drink function using a switch, and a looping input flow that manages health and mana.
Explore using pointers in C++, dereference and pass memory addresses to functions, convert between pointers and references, and manipulate values like treasure amounts through a treasure map example.
Learn how to cast void pointers in C++ using C-style casts and static_cast, convert void pointers to integer pointers, and safely dereference them.
Revisit arrays in C++ and access their values via the dereference operator and pointers, print the array's memory address, and loop through items using std::size in C++17.
Explore how stack memory stores local variables and function data in a last-in, first-out structure, is automatically managed, and contrasts with heap memory for C++ game development.
Explore heap memory and dynamic memory allocation using new and delete, compare it with stack memory, and understand memory leaks with data like textures and models.
Learn how memory leaks occur when heap data remains after a scope ends, release it with delete, and prevent memory access violations with null-pointer checks and clearing the pointer.
Learn to manage treasure in C++ with pointer-based allocation, checks for null pointers, upgrading treasure value, transferring between chests, and safe memory cleanup.
Explore unique pointers, a type of smart pointer that ensures exclusive ownership and automatic memory cleanup on scope exit, preventing double deletion via move.
Understand how shared pointers enable multiple ownership of objects. They clean up memory via reference counting and keep textures and models alive until the last pointer goes out of scope.
Learn how a weak pointer provides a non-owning reference to an object managed by a shared pointer, preventing cyclic references and enabling safe locking when needed.
Explore a practice solution using unique_ptr and shared_ptr to manage a legendary treasure and a shared treasure among pirates, stored in a vector, with allocation, deallocation, loops, dereferencing, and use_count.
Explore object oriented programming as a paradigm that focuses on objects and classes, enabling modular, reusable, and scalable game development through object attributes and behaviors.
Introduce classes and encapsulation in c++ for game development, grouping player data (name, health, attack power) into a class and implementing behaviors like attack with abstraction.
Instantiate a player object from a class, access its attributes with the dot operator, set name, health, and attack power, and call its attack.
Master class constructors in C++ for game development by initializing new player objects with default and custom constructors that set name, health, and attack power, including inline initializers.
Explore advanced constructors in C++ for game developers, including explicit default, overloaded, and delegating constructors, with string and const char* usage, code reuse, and compile-time polymorphism.
Explore destructors in C++, see how they run when objects go out of scope or are deleted, and apply RAII to pair new with delete and prevent memory leaks.
Explore member functions and member variables in C++ by creating and calling functions on heap-allocated objects via the arrow operator, and on stack objects, including basic destructor behavior.
Learn how access specifiers private, public, and protected define member accessibility in C++, with examples of inheritance and protecting the player name.
Learn how getters and setters protect a private health member, ensuring health never goes below zero, by validating input and managing damage through a controlled interface.
Master const variables and functions in C++ to prevent unintended modifications, enhance safety and optimization, and enforce proper return usage with nodiscard and const references in game development.
Explore inheritance in c++ by defining a base enemy class and deriving zombies and other types, reusing shared health and take damage logic with infection damage.
Modify derived classes by using protected members instead of private, overriding attack with virtual and override, and calling via references or pointers using the arrow operator for goblin and zombie.
Demonstrate polymorphism by turning the enemy into an abstract class with a pure virtual take damage, override in goblin and dragon, and use a virtual destructor for proper cleanup.
Learn how the copy constructor creates a new object as a copy and how deep copies protect pointers from dangling pointers in a weapon class example.
Learn how the move constructor steals resources from a temporary weapon object instead of copying it, transferring ownership via an r-value reference to avoid unnecessary copies.
Understand the copy assignment operator and its deep copy to replace an existing object's contents. Explore self-assignment checks, memory management, and move semantics with move constructors and move assignment operators.
Explore operator overloading to redefine built-in operators for user-defined types like classes and structs, enabling weapon comparisons with a custom is equal to operator and examining plus and minus.
Move a class from main to dedicated header and cpp files, organizing declarations in the header and definitions in the cpp, with include guards or pragma once for modern compilers.
Learn how template classes in C++ enable a single class to handle multiple data types, improving code reuse, type safety at compile time, and performance.
Learn to implement a template game object that safely manages dynamic memory with the big five: default, copy, and move constructors and assignments, plus destructor and get/set component.
Explore the static keyword in C++, focusing on static variables inside functions. Learn how they retain value between calls and differ from non-static locals.
Learn how static variables in a class are shared by all objects and track players across games, with outside-class initialization and updates to player count as games start or end.
Learn how static methods belong to a class in C++, call them with ClassName::method without an instance, and why they cannot access non-static members.
Explore global static variables in C++ by keeping them in a cpp file and inaccessible from other files, while using extern for cross-file access and static to prevent external modification.
Discover how CMake, an open source build system generator, manages C++ projects by generating make, Ninja, Visual Studio, and Xcode build files from cmakelists.txt for Windows, Linux, and Mac OS.
Verify your cmake installation by running cmake --version in the command prompt to check the version, and add cmake/bin to the system path via environment variables if needed.
Create a saga game project with CMake, defining the CMakeLists, minimum version, and C++ 17 standard, while disabling extensions and building cross‑platform with CMake -S and -B.
Add your saga project to the cmakelists.txt by configuring an add_executable with saga/src/main.cpp, create a source folder, and rebuild with cmake to run hello world as startup project.
Discover how to split CMake files into solution and project lists, define targets with variables like saga_game_target_name, use add_subdirectory, and streamline building a saga game hello world in Visual Studio.
Fetch external libraries with cmake to enable sfml graphics, window, and system support. The lecture covers retrieving sfml from GitHub, selecting version 3.0 for cpp17, and wiring it into build.
Create a window with SFML by initializing a render window at 800x600, handling the close event in a loop, then clear to black and display.
Discover how to add a post-build command in CMake to copy Sfml DLLs to the target directory, using a custom copy lib to target function.
Establish a structured c++ game project by creating include and framework folders, adding application.h and application.cpp, and updating cmake to include sfml graphics, window, system, and audio.
Create an application class in the saga namespace with an SFML render window and video mode. Manage includes and CMake setup, and implement a run loop using a unique_ptr.
Create a tick-based game loop that updates game logic, physics, and rendering, using delta time or a fixed time step of 60 frames per second to maintain consistent physics.
Refactor the render loop into its own function, clear the window, and draw a centered red rectangle using sfml shapes and origin adjustment.
Refactor the render loop by moving clear, draw, and display into render internal, enable virtual overrides for render and tick with delta time, and track frame timing.
Encapsulate the entry point by hiding the main function inside the engine using the template method pattern, letting the game supply specific implementations via virtual functions.
separate the engine and the game into two projects, configure cmake to build a static saga engine library and a saga game, and link them through a game framework.
Implement a hidden main entry point by exposing a get application function that lets the Saga engine initialize and run the game, enabling modular design, encapsulation, and scalable reuse.
Create a centralized core logging system for a game engine by replacing std::cout with a fast printf-based log macro, wired into the engine via CMake.
Redefine core data types to centralize definitions and enable consistent naming, renaming unordered map to dictionary, and introduce templates for custom smart pointers and aliases for maps and vectors.
Create a world class to manage multiple game worlds, inspired by Unreal Engine, with begin play and tick logic, an owning application, and proper lifecycle and header/source setup.
Implement a template world loader in the application to hold the current world. Use shared and weak pointers to load different world types and manage begin play with tick.
Debug the renderer by inspecting the main game loop, place render calls inside the correct loop, and ensure delta time handling and ticking synchronize with rendering.
Define an actor class owned by a world, with position, rendering, lifecycle methods such as begin play, tick, and destruction, and header and C++ setup.
Explore spawning actors into the world using a template spawn actor function that manages active and pending lists with weak pointers and begin play and tick updates.
Develop an object class to safely destroy actors using a pending destroy flag, with constructors, destructors, and logging, and make actors inherit this object to handle destruction in the world.
Learn to safely destroy actors by iterating a list, erasing pending destroy entries with iterators, and using weak pointers and locking to avoid memory leaks.
Refactor the game window to let the game application control width, height, and title via the constructor, using SFML style flags for a fixed-size window with a title bar.
Add a sprite to an actor with SFML 3.0 by loading a texture from file, attaching it to m_sprite, and setting the texture rect.
Learn to render an actor sprite by implementing a render function, passing and retrieving the render window from the world, looping through actors, and loading textures.
Import textures and sprites, set texture paths, and render simple assets in a C++ game project. Prevent rendering and ticking after an actor is destroyed by checking is pending destroy.
Set up CMake to copy assets into the build folder by defining the resource folder and source directory, then configure a post-build command for the saga game.
Configure the resource directory to load assets from the source folder in debug mode and from the final build directory in release mode, using a config file and CMake integration.
Create a singleton asset manager to load, store, and cache textures, fonts, and audio, reducing redundant allocations and boosting game performance.
Set up an asset manager to load textures from a path using a shared pointer, and cache them in an unordered map keyed by path.
Fetch textures from the asset manager and lazy-load the actor sprite using an optional texture, and assign the texture in place once loaded, with robust texture path checks.
implement a clean cycle in the asset manager to remove unused textures from memory, preventing memory leaks and improving performance, with a two-second cleanup interval.
Develop and test actor transformation functions in a 2d C++ game, implementing set/get location and rotation, offset operations, and degree-based rotation, then validate with a center position and 90-degree rotation.
Learn to center the pivot of actor sprites by computing global bounds and setting the origin to the center, enabling accurate rotation and a solid foundation for game engine development.
Implement a ship class in the Saga game engine with a constructor, tick, and velocity getters/setters using a 2d sfml vector, updating position each frame.
Create the player ship class in C++, inheriting from the ship base class, with header and cpp files and a constructor taking the world pointer and a path reference.
Create a root directory setter in the asset manager and use it to build asset paths. Apply this to the player ship loading, centralizing textures and resources.
Define the player ship input system by overriding tick, creating handle input and transform input functions, and using a speed variable to move with w, a, s, d.
Learn to implement diagonal movement in a game by removing the else-if chain and normalizing input to keep constant speed. Adjust the set velocity logic accordingly.
Learn to obtain the window size with SFML, expose a get window size in the application, and bridge it through the world to clamp player input to the window.
Clamp player input to the window by checking actor location against window bounds and adjusting move input to zero or one, ensuring the ship stays inside the screen.
Create a base projectile class within a weapon module to support multiple projectile types, manage the owner, and implement abstract fire logic and cooldown checks.
Implement a kinetic projectile class derived from the projectile, with a cooldown clock and fire logic, integrated into the player ship for spacebar firing.
Learn to refactor a C++ project by renaming the kinetic projectile to kinetic weapon, updating header and cpp files, and aligning the player ship with the new class.
Create a new projectile header and cpp, refactor into a weapon class, initialize with world, owner, texture path, speed, and damage, and implement getters and setters.
Learn to implement projectile movement in C++ by updating tick, computing forward direction from rotation, converting degrees to radians, and moving the actor with delta time and speed.
Spawn projectiles from a kinetic weapon by obtaining the world from the owner and spawning a projectile with texture path. Align the projectile's location and rotation to the owner's transform.
Debug the projectile movement by converting degrees to radians and using sine for vertical and cosine for horizontal directions, and replace the projectile with star tiny.png while tuning the cooldown.
Learn how to remove off-screen projectiles by calculating each projectile's bounds, comparing against the window size, and destroying objects with a test log when out of bounds.
Implement a world level clean cycle to batch destruction of projectiles and actors, moving destruction logic from tick to the world class and integrating with the application loop.
Move the include and fetch sections for the SFML library from the base CMakeLists to the engine CMakeLists, keeping the base minimal, and reload after changes to verify the cleanup.
Implement an axis-aligned bounding box collision system by iterating actor pairs, checking bounds with sfml find intersection, and handling on overlap, with plans to refactor into a dedicated physics system.
refactor collision detection into a physics system that processes overlaps for a list of actors, wiring into world and projectile logic.
Create an enemy ship class inheriting from the ship, with world and texture path, and override tick and on overlap; spawn, set location and rotation, then destroy on player collision.
Implement an immediate removal system for projectiles and enemies on collision, using a queue and vector to safely remove actors during tick while preserving out-of-bounds cleanup.
Create a reusable health component in c++ for game ships, managing max health, applying damage, checking is dead, exposing health via a getter, and attaching it to enemy ships.
Apply damage to enemy ships using an on overlap handler, a damage function, and a health component; track remaining health, log hits, and remove destroyed enemies immediately.
Set a player as the enemy target, compute a normalized direction toward the player, and move the enemy at a defined speed using delta time in a bullet hell chase.
Spawn enemies off screen by using a spawn clock and a 1.5 f interval, calculating spawn positions at the window edges via random sides in the tick function.
Enable left mouse firing and aim toward the mouse by computing the world space aim angle from the mouse position using sfml utilities and atan2 to degrees.
Learn to add debug bounding boxes in the render loop using SFML, with a toggle macro to draw green-outlined transparent rectangles around sprites.
Create a custom collision shape with an enum for box and circle, and implement getters for shape, center, and radius; adjust debug draw to render a circle when needed.
Implement a custom collision shape in the physics system using circle and box colliders. Compute delta and distance, and compare to the sum of the two radii to process overlaps.
Add basic enemy attacks by wiring a kinetic weapon to the enemy ship, implementing a 2.0 second fire cooldown, and having the enemy rotate toward and fire at the player.
Create owner based projectiles by using a player and enemy projectile type enum, color code each projectile in begin play, and apply damage on overlap based on the owner.
Add a health component and apply damage logic to the player, apply enemy projectile damage, and queue removal when dead to trigger a game over.
centralize damage settings by implementing a get projectile damage function on the base ship and override it in the player ship, defaulting to 10 and returning 20 for the player ship.
Create a ship stats component to centralize ship attributes, exposing getters and setters for projectile damage, move speed, fire cooldown, and max health, initialized to 10, 300, 0.5, and 100.
Implement a ship stats component in the base class to centralize projectile damage, move speed, fire cooldown, and max health for enemy and player ships.
Create a spread shot weapon by deriving from the base weapon, implementing constructor parameters for owner, cooldown time, and projectile count, and managing a spread angle with cooldown logic.
Implement a spread shot by computing a base angle from the player's rotation, centering around the ship's facing direction, and spawning multiple projectiles with angle offsets, damage, and ownership-based type.
Implement firing angle for the spreadsheet weapon so it fires toward the mouse using the player ship's aim angle, replacing the base angle, and balance by adjusting projectile speed.
Decouple the fire cooldown from ship stats, basing it on each weapon type, such as kinetic or spread shot. Integrate setters and getters for cooldown time in the weapon header.
Track enemy deaths by implementing an add enemy kill function and a get enemy kill count in the game application, updating and logging the kill tally during projectile collisions.
Implement a weapon upgrade by activating a spread shot after ten kills, adjusting the kinetic weapon, updating headers and inheritance to support the upgrade, and validating via gameplay tests.
Learn to build a kill count UI by importing Kenny fonts into the assets, configuring a render window, and updating the on-screen text as enemies are defeated.
Create and manage game states (main menu, running, game over) to drive the game loop and render title, start prompt, and final score using a UI.
Display the game over screen by switching to the game over state on player death, show the final score and enemy kill count, and prompt press enter to restart.
Use the tick function to detect the enter key and switch main menu, running, and game over, then start or restart the game by resetting state, world, and player ship.
Implement a basic player health UI by integrating a health component and retrieving health and max health. Compute health percentage and render an on-screen health text update.
Implement a health bar in SFML using rectangle shapes for the background and fill, updating width based on health percentage and drawing order so the text appears on top.
This course is a comprehensive, project-based program designed to guide you through building a complete, functional 2D Game Engine and a game from the ground up using C++. Master modern C++ programming principles and apply them directly to create your own scalable game engine and a complete game using the SFML 3 library and the CMake build system.
Who is this course for?
This course is for developers who have a foundational understanding of programming and are looking to specialize in C++ for game development, transitioning from core principles to professional engine architecture.
Course Progression and Key Modules:
The curriculum is structured sequentially, moving from core language features to complex game systems:
Module 01: C++ Fundamentals: Solidify your foundation with a deep dive into core C++ syntax, common data types, control flow (If statements, Switch statements, Loops), functions, and standard data structures like Arrays, Vectors, and Maps.
Module 04: Object-Oriented Programming (OOP): Learn the core of professional C++ design. This module covers Classes, Constructors, Destructors, Access Specifiers (public/private), Inheritance, Polymorphism, Operator Overloading, and managing class member functions with Const and Static keywords.
Module 03: Memory and Pointers: Demystify C++ memory management. You will explore Stack and Heap memory, learn to avoid common issues like memory leaks, and master Smart Pointers (Unique, Shared, and Weak) for safe, efficient resource management.
Module 05: Building the Game Engine: This is the heart of the course, where you build the core architecture. You will install and configure the CMake build system, integrate the SFML graphics library, establish the project's structure, implement the main Tick and Render Game Loops, and design core engine classes such as Application, World, and the Actor base class.
Game Feature Implementation (Modules 06 - 11): Apply your engine knowledge to build out a full game:
Player & Projectiles: Implement player input, clamping movement to the screen, and creating owner-based projectile systems with their own movement logic.
Physics System: Implement basic Collision Detection, the Health Component, and enemy AI behaviors like Chasing and off-screen Spawning.
Damage & Health: Centralize damage settings, create a Ship Stats class, and implement the logic for applying damage to both the player and enemies.
Weapon Upgrades & UI: Develop features like Spread Shot, implement a system to track enemy deaths, and build the user interface, including the Main Menu, Game Over Screen, Kill Count, and Health Bar.
Debugging & Polish: Finalize the game with touches like basic player rotation, Camera Shake effects, and a complete Sound System for audio polish.
By the end of this course, you will have a fully working, self-built C++ game engine, giving you the practical experience necessary to tackle more ambitious projects.