[widgets_on_pages id=”udemy_code_details”]
[widgets_on_pages id=”udemy_advert_cpp_1″][widgets_on_pages id=”udemy_code_details”]
There will be a whole range of game related mini-projects to accompany this course and you will be able to choose which ones you are most interested in completing. I would suggest however that you try out all the practical projects that are suggested throughout these tutorials as you will learn faster.
This course is also the place to start if you want to progress to learn to code for many different development platforms. For example C++ is the language of Unreal Engine and CryEngine the two most advanced game engines available. This C++ course will be especially relevant if you are an aspiring indie developer who wants to make super-fast 2d games; perhaps you want to get your game on Steam? C++ is the place to start. To accompany this C++ course there will be practical projects that use the SFML C++ library which is probably the best way for someone just starting game development who wants to make 2d games for any of the desktop operating systems. These mini-projects will lead to full working game projects.
This C++ course will assume you know absolutely nothing about C++ or any other programming language. It will explain all jargon as we proceed through each tutorial.
At times in the course, we will take an optional break from theory to do an appropriate project. These projects are hands-on real coding and are much more fun than theory. All the projects will be as game related as possible, including some full working games. The tutorial list here will grow over the coming days and weeks.
Explaining code through comments
Sometimes I will add extra explanation or clarification within the code itself. To do this I will use C++ comments. Whenever you see a line of code with two forward slashes- like this // at the start, that line of code doesn’t do anything except tell you something about the code. In our C++ programs, we will use comments to remind us of what different blocks or lines of code achieve. Here is what a comment looks like.
// I am just a comment and don't really do anything spaceShip.shoot(alien); // The line of code above shoots an alien // That was a useful comment wasn't it
Enough of all the introductions let’s get on with the tutorials.
The C++ game coding tutorials
The tutorials are designed to get you coding games as fast as possible. They are not fully comprehensive and some topics have been trimmed to the maximum. I am sure that the best way of learning to code C++ games; is to code C++ games. So the sooner we can start doing that the better. You will find that all of the practical C++ projects on this site come with loads of refresher information and of course lots of useful C++ comments using “//”. So don’t feel you need to master a topic before moving on. You can always refer back.
1 – Game Variables in C++
This tutorial introduces the fundamental C++ building blocks of our game, variables. The variables tutorial explains how we keep track of the state of our game when writing in C++. Variables can be everything from the players score to an entire level of our game. Let’s get started and learn about game data and variables in C++.
[widgets_on_pages id=”bcgp_cfgp_gpp”]
2 – Manipulating Game Variables in C++
This tutorial shows us the mathematical way in C++ that we can change our game’s data that is contained within our variables. After all, the player’s score does not remain static. Changing game variables in C++.
3 – Checking for conditions in C++
Now that we can use variables to represent all the vital data in our game we will see how we can test for important events called conditions within our game. How do we know when the player has lost their last life or achieved a new high-score? Find out about Checking for conditions in C++.
4 – Branching our C++ game code
Here we will use everything we learned about conditions and variables so far to make our game take a different course dependent upon an outcome. Learn about Branching our C++ game code.
5 – Looping our game code
In game coding, we will regularly want to execute parts of our code multiple times while making subtle or not-so-subtle variations to our C++ code on each pass. For example, each and every frame of our game is contained in just such a loop. This is how it works: Looping our game code.
6 – Organizing code with functions
Functions are the organizing blocks of our code. We can think of a function as a black box that does one very specific task and can be reused over and over. Learn how we organize our game code with C++ functions.
7 – Introducing OOP for C++ games
OOP is probably the most vital topic in modern game coding. How do we break down our planned game and the objects (like characters, spaceships, and levels) into its most appropriate constituent parts? Find out in this introduction to OOP in C++ game coding.
8 – Game data handling with C++ arrays
C++ arrays are what enable us to manage lots of objects in our game in an orderly manner. It is all well and good to have a well-designed object that can represent a zombie, an invader or a bullet; but what about when we need dozens, hundreds or even thousands of them? This brief tutorial solves the problem by learning about C++ arrays.
[widgets_on_pages id=”udemy_advert_cpp_2″][widgets_on_pages id=”udemy_code_details”]
9 – Using C++ references to make code faster
When we pass values to a function or return values from a function that is exactly what we are doing. Passing or returning a value. What happens is that a copy of the variable’s value is made, and sent into the function where it is used. Nothing happens to the actual variable itself. C++ references allow us to work around this. But why would we even want to? Using C++ references to make code faster.
10 – Controlling game memory with C++ pointers
Pointers have a bad reputation. They can appear complicated or convoluted. Add to this, the way pointers can be used in C++ code has evolved in recent years. I believe the best way to understand them is to use them in their original (old-fashioned) form. You can’t understand how an internal combustion engine works if you go straight to a supercar. So what is a pointer? Controlling game memory with pointers.
Be sure to complete all the related SFML game projects.
11 – Organizing game data with C++ Maps
Maps are a convenient, organized, fast and intuitive way to organize key-value-pairs. That, is, pairs of data which go together that map to one another. Read about Maps in C++.
i am willing to learn. How to get started?
Hi Maria,
I am working on the C++ tutorials at the moment which is why this page is blank. C++ would probably be the way to go if you wanted to develop games for desktop(Mac, Windows, Linux). If this is what you want then bare with me the tutorials to get started and make games will start arriving over the next few weeks. If you are unsure what type of games you want to make or which platform(Android, iPhone, PC etc…) then this article Making games: Where do I start might help.
Thanks for your comment.
Where would be the best download for C++? could you give me a link?
All the example projects on this site use Visual Studio as the C++ editor and compiler. You can start writing C++ code with just Visual Studio. If you want to follow along with the game related examples and projects on this site you will need to do a little bit more preparation and use SFML in conjunction with Visual Studio. This tutorial will help you prepare both Visual Studio and SFML. Hope this helps.
This definitely helps thank you. I am going to be making Pong and this is what I needed to get started. Thanks again bunches.
I am making a project in my class 😛
Good luck Mathew!
Thanks!!!
This is a gem of a website! Awesome
Many thanks Chris.
I’m new to coding and I can’t find a good place to start learning
Hi Abby, it depends what games you want to make. On this site there are beginner tutorials for Android games in Java or Windows desktop games in c++. If you are not sure where to start try this article. http://gamecodeschool.com/blog/making-games-where-do-i-start/. Good luck. Hope you get started soon.
Hey,
Could you help me? I want to learn to code pc games (mostly 3d based) but i dont know how to start or which language (i tried kava but it is too hard so maybe even an easy one?)
Arguably the easiest way to get started with 3D games is Unity. This would involve learning C#. If you want to consider all yuor options, take alook at Making video games, where do I start?
I want to ask that if i read all these tutorials than will i learn whole C++ programming language? And i will make my own game that i wanted to make inC++
Hi. No it won’t teach the whole language it will just give you a very brief introduction to get you started. By the end of all the tutorials and projects you will be able to get started on some simple games of your own. It will take more study and much practice to master.
hey,
can you plz help me out?? I’ve visual studio 2010 in my laptop… Will it help making a game…in c++??
This could be a challenge. The problem would be to find a matching version of SFML and then catering for the differences in SFML. You might want to contact SFML and ask which version to start from and then you could paste in my code and start working through the errors one by one. https://www.sfml-dev.org/download/sfml/old-versions.php
I know nothing of coding, i know just enough to be dangerous at EXCEL lol. I run a small fire dept and am very interested in creating a database to track fire fighter stats, equipment… keep track of vehicles ect. there will be alot to it, i know i can do this simply, but i want something in an app which the members can use and interact with. Something almost gamified and beautiful. Will learning C++ help me achieve this? I’ve definitely got ideas way outside my ability to create them. I am even now thinking of creating and using NFT’s as the visual profiles for the members, vehicles and equipment.
Sounds like a cool idea. For simple pretty Ui on windows try Java. If you want the app to run in a web browser from anywhere and involve NFTs then consider searching for Moralis. There is a good series on YouTube which I am learning about myself.