Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Learning Path: C++ Game Programming
Rating: 4.1 out of 5(144 ratings)
1,047 students

Learning Path: C++ Game Programming

Develop your game programming skills by creating innovative and customized games from scratch with C++
Last updated 12/2017
English

What you'll learn

  • Get to know C++ from scratch while simultaneously learning game building
  • Learn the basics of C++, such as variables, loops, and functions, to animate game objects, respond to collisions, keep the score, play sound effects, and build your first playable game.
  • Use more advanced C++ topics such as classes, inheritance, and references to spawn and control thousands of enemies, shoot with a rapid fire machine gun, and realize random scrolling game worlds
  • Stretch your C++ knowledge beyond the beginner level and use concepts such as pointers, references, and the Standard Template Library to add features—for example, split-screen co-op, immersive directional sound, and custom levels loaded from level-design files
  • Get ready to go and build your own unique games!

Course content

2 sections89 lectures8h 50m total length
  • The Course Overview4:25

    This video provides an overview of the entire course.

  • The Games, C++, and SFML4:24

    SFML has the potential to build the highest-quality 2D games. So a beginner can start using SFML and not worry about having to start again with a new language/library as their experience grows. Let's explore the games we will build using SFML.

  • Setting Up the Development Environment6:20

    Now that we know about how we will be making these games, it is time to set up a development environment. This video will show us how to proceed with that.

  • Planning Timber!!! and Creating a Project from the Template3:43

    If we don't know how the game is going to work on the screen, how can we possibly make it work in code? Let's learn how to plan the game and create a new project from the reusable project template.

  • Adding Project Assets and Understanding Co-ordinates4:52

    Assets are things we need in order to make a game. It mainly includes font, sound and graphics. We must know how to add them. This video guides us with assets and understanding screen and internal co-ordinates.

  • Starting to Code the Game8:38

    It's time to apply all that we've learned and start coding the game. This video will guide us with the initial code and explain what each line of code does.

  • Opening a Window using SFML5:22

    We've studied about SFML but using SFML can be a bit tricky. Let's explore how we can use SFML features to open a new window.

  • The Main Game Loop4:33

    We need a way to stay in the program until the player wants to quit. Also, we must provide a way for the player to exit. Otherwise the game will go on forever. This video will help us achieve this goal.

  • Drawing the Game Background3:35

    At last, we need to add some real graphics in our game. Let's see how we will create and draw the game background and display it.

  • Handling Errors3:29

    There will always be problems and errors in every project you make, that is guaranteed. Let's learn about the types of errors so that we are able to identify and rectify them whenever they occur.

  • C++ Variables6:01

    Variables are the way that our C++ games store and manipulate values. If we want to know how much health the player has then we need a variable. Is the game over or still playing? That's also a variable. So, let's first learn about variables before we proceed with our game.

  • Manipulating Variables3:03

    At this point, we know exactly what variables are, the main types, and how to declare and initialize them, but we still can't do many operations with them. We need to manipulate our variables, add them, take them away, multiply, divide, and test them. Let's explore manipulating variables.

  • Adding Clouds, a Tree, and a Buzzing Bee5:00

    In this video, we will add clouds, a tree and a bee to our game. This is going to be easy. We will use exactly the same procedure that we used in the previous section when we drew the background.

  • Random Numbers3:23

    Random numbers are useful for a lot of reasons in games. Perhaps you could use them for determining what card the player is dealt with. This video will demonstrate using random numbers to determine the starting location and the speed of the bee and the clouds.

  • Making Decisions with if and else5:14

    The C++ if and else keywords are what enable us to make decisions. We have already seen if in action in the previous section when we detected, in each frame, whether the player had pressed the Esc key. So, it'd be quite easy to learn.

  • Timing4:13

    Before we can move the bee and the clouds, we need to consider timing. As we already know, the main game loop executes over and over again, until the player presses the Esc key.

  • Moving the Clouds and the Bee6:34

    Let's use the elapsed time since the last frame, to breathe life into the bee and the clouds. This will solve the problem of having a consistent frame rate across different PCs.

  • Pausing and Restarting the Game3:41

    As we progress with this game over the next three sections, the code will obviously get longer and longer. So, now it seems like a good time to think ahead and add a little bit more structure into our code. We will add this structure to give us the ability to pause and restart the game.

  • C++ Strings, SFML Text, and Font3:17

    In the previous section, we briefly mentioned strings and we learned that a string can hold alphanumeric data. We didn't look at declaring, initializing, or manipulating strings. So let's do that now and briefly discuss the Text and Font classes.

  • Adding a Score and a Message6:35

    Now we know enough about strings, SFML Text, and SFML Font to go about implementing the HUD. This video will show us how to add a score and a message to our game screen.

  • Adding a Time Bar6:07

    As time is a crucial mechanic in the game, it is necessary to keep the player aware of it. It will give him a sense of urgency as the end of the game draws near, and a sense of accomplishment if he performs well enough to maintain or increase his remaining time.

  • Loops5:03

    In programming, we often need to do the same thing more than once. The obvious example that we have seen so far is our game loop. There are a few different types of loop and we will look at the most commonly used.

  • Arrays4:04

    If a variable is a box in which we can store a value of a specific type, like int, float, or char, then we can think of an array as a whole row of boxes. Let's learn about arrays in detail so we know how to use them.

  • Making Decisions with switch1:48

    We have already seen if, which allows us to make a decision whether to execute a block of code based upon the result of its expression. Sometimes a decision in C++ can be made better in other ways. This video will demonstrate using switch.

  • Class enumerations2:12

    An enumeration is a list of all the possible values in a logical collection. They make the code clearer and less error-prone. Let's learn how to use class enumerations.

  • Getting Started with Functions10:36

    A function is a collection of variables, expressions, and control flow statements (loops and branches). In fact, any of the code we have learnt about in the course so far can be used in a function. Let's explore C++ functions in this video.

  • Growing the Branches8:08

    This last video of the section will guide us in using all the new C++ techniques to draw and move some branches on the tree.

  • Preparing and Drawing the Player and Other Sprites3:11

    As we now move closer to running the game. Let's add the code for the player's sprite, as well as a few more sprites and textures and then draw them.

  • Handling the Player's Input8:46

    Lots of different things depend on the movement of the player, such as when to show the axe, when to begin animating the log, and when to move all the branches down a place. This video shows us how to set up the keyboard handling for the player chopping.

  • Handling Death1:49

    Every game has to end badly, with either the player running out of time (which we have already handled) or getting squished by a branch. Let's see how to detect the player getting squished.

  • Simple Sound FX3:46

    We've built the game but it has no sound yet. To complete the game, we will add three sounds. Each sound will be played on a particular game event. Let's identify what are the sounds and when we'll play them.

  • Improving the Game and the Code2:07

    Now that we've built the game, let's take a look at these suggested enhancements for Timber!!! project. This video will show what the enhanced version of our game look like.

  • Planning and Starting the Zombie Arena Game7:22

    Understand and start with our Zombie Arena game.

  • Object-Oriented Programming16:21

    Manage, change, or update easily to with OOP.

  • Building Player - The First Class21:28

    Player class benefits from knowing a few details about the overall environment the game is running in.

  • Controlling the Game Camera with SFML View4:28

    Controlling the Game Camera with SFML View

  • Starting the Zombie Arena Game Engine5:07

    Start the game engine by using the updated code.

  • Managing the Code Files1:45

    Manage the code to reduce its length and make it concise.

  • Starting Coding the Main Game Loop8:08

    In this video, we will learn how to manage the code for game.

  • C++ References6:37

    What do we do if we need to work on a number of complex objects which are needed in the main function? References are the solution to this problem.

  • SFML Vertex Arrays and Sprite Sheets8:00

    SFML allows us to load a sprite sheet as a regular texture in exactly the same way we do for every texture. So, let's see how to do it.

  • Creating a Randomly Generated Scrolling Background8:18

    Now that we have our hands on with C++ References and we are capable of creating Sprite sheets, let us step ahead and learn to generate a scrolling background.

  • Using the Background2:43

    By the end of this video you will be able to use and render the background. So, let's jump right in.

  • Getting Started with Pointers9:29

    Pointers are variables that hold memory addresses. Typically, a pointer will hold the memory address of another variable. This sounds a bit like a reference but in this video, we will see how they are much more powerful.

  • Working with Pointers8:31

    Now that we have learned the basics about pointers. We will use a pointer to handle an ever-expanding horde of zombies.

  • The Standard Template Library8:10

    The STL is a collection of data containers and ways to manipulate the data we put in those containers. Or to be more specific, it is a way to store and manipulate different types of C++ variables and classes. Let's learn more about STL in this video.

  • The TextureHolder Class5:57

    Thousands of zombies represent a new challenge. Not only would loading, storing, and manipulating thousands of copies of three different zombie textures take up a lot of memory, but also a lot of processing power too. This video will show us how to use the TextureHolder class to solve this problem.

  • Building a Horde of Zombies10:13

    We are now armed with the TextureHolder class to make sure that our zombie textures are easily available, as well as only loaded into the GPU once, we can look into building a whole horde of them.

  • Creating a Horde and Bringing It Back to Life9:36

    Now we have a class to create a living, attacking, and killable zombie. This video will show us how to spawn a whole horde of them.

  • Using the TextureHolder Class for All Textures2:30

    Since we have our TextureHolder class, we might as well be consistent and use it to load all our textures. Let's make some very small alterations to the existing code that loads textures for the background sprite sheet and the player.

  • Coding the Bullet Class11:02

    As of now, we have a controllable character running around in an arena full of zombies that chase him. The problem is that they don't interact with each other. We need to detect collisions between the zombies and the player and give him bullets to defend himself.

  • Making the Bullets Fly7:49

    Now that we've given the player bullets, we need to make them usable. This video will show us how to get the bullets working.

  • Giving the Player a Cross-Hair2:41

    The player would see a mouse cursor on the screen, at this moment. We have to replace it with a crosshair which gives him an aim to shoot on and looks cool as well. Adding a crosshair is easy and only requires one new concept. We'll see that in this video.

  • Coding a Class for Pickups11:57

    In this video, we will code a Pickup class that has a Sprite, member as well as other member data and functions. We will add pickups to our game in just a few steps.

  • Using the Pickup Class3:02

    After all that hard work implementing the Pickup class, we can now go ahead and write code in the game engine to actually put some pickups into the game.

  • Detecting Collisions8:12

    We need to know when certain objects from our game touch certain other objects. We can then respond to that event in an appropriate manner. In our classes, we have already added functions to call when our objects collide. So, let's see how we'll detect collisions.

  • Adding All the Text and HUD Objects4:26

    Familiarize yourself with the details added to the code, especially the variable names.

  • Updating the HUD Each Frame3:24

    Understand how to slow down our game loop.

  • Drawing the HUD, and the Home, and Level-Up Screens2:43

    HUD stays neatly positioned over the top of the main game action after drawing it.

  • Saving and Loading the High-Score3:13

    Create and save the high score for each game.

  • Preparing Sound Effects1:32

    Create sound effects to the game.

  • Leveling Up2:40

    Enable the player to level-up.

  • Restarting the Game1:04

    Modify code and restart the game.

  • Playing the Rest of the Sounds3:14

    Play the sound and the final game.

Requirements

  • Basic prior knowledge of game development and C is recommended, but not required.

Description

Are you looking to learn C++ from scratch and simultaneously build stunning and interactive games?

Explore this Learning Path and you'll get what you're looking for. Start as an amateur and rise as a pro by taking this Learning Path.

This Learning Path is a fun journey to the world of game programming starting from the very basics of C++ such as OOP, pointers, introduction to the Standard Template Library, and finally building OpenGL-powered SFML fully-playable complex games. 

These games are an addictive frantic two-button tapper, a multi-level zombie survival shooter, and a split-screen multiplayer puzzle-platformer.

You will explore exciting game programming concepts such as particle effects, directional sound, OpenGL programmable Shaders, spawning thousands of objects, and more.

Packt’s Video Learning Paths are a series of individual video products put together in a logical and stepwise manner such that each video builds on the skills learned in the video before it.

Author:

John Horton

John Horton is a coding and gaming enthusiast based in the UK. He has a passion for writing apps, games, books, and blog articles about programming, especially for beginners. He is the founder of Game Code School , which is dedicated to helping complete beginners get started with coding using the language and platform that is best suited for them. John sincerely believes that anyone can learn to code and that everybody has a game or an app inside of them, and that they just need to do enough work to bring it out.

Who this course is for:

  • If you are a game developer and looking to explore C++ game development, then this is perfect course for you.
  • This course offers a fun, example-driven approach to learning game development and C++. In addition to explaining game development techniques in an engaging style, you’ll learn the key C++ topics by building a game in a practical (not theory-based) way, with multiple runnable/playable stages in each section.