patreon

 

 

C++ game coding: Learn to make games using the C++ programming language.

If you have no programming experience but want to get started as fast as possible, or if you need a quick C++ refresher then this level 1 course is the place to start.
We will waste no time in getting you started on your journey to writing great games for the PC, using C++. A collection of free articles to suit all C++ beginners. The journey will be smooth as we will learn the fundamentals of the super-fast C++ language, a step at a time and then put the new knowledge to use, with practical game projects using SFML, OpenGL powered library.

Beginner’s Guide to Handling Errors in C++

Writing error-free code is a crucial skill for any programmer. This guide will provide beginners with an overview of handling errors while writing C++ code.  We will cover different types of errors, including configuration errors, […]

Using C++ vectors

Here’s a quick tutorial on using the C++ from the Standard Template Library (STL). Be sure to check my tutorial on C++ maps, also from the STL. The Standard Template Library (STL) is a collection […]

Coding a simple text adventure in C++

As the last tutorial before we install a graphics library I thought a simple example that involves a game loop but no graphics would be worth while. Here’s a simple C++ tutorial for creating an […]

Organizing your Game Data with C++ Maps

Maps are a great feature of C++ they allow us to store objects (made from classes) of any type and store them paired with any other variable. One useful combination I have used a fair […]

C++ Game Coding Level 1

This course is for you if you are completely new to programming or the C++ language. This tutorial course will explain all you need to know to code C++ games as quickly as is realistic. This course will also […]

Game variables in C++

Whenever we code a PC game, we need to ‘know’ what the situation in the game is at any given point in time. As an example, things like the player’s score, how many people connected to the game lobbies, […]

Manipulating the value of our game’s variables

Having just learned what C++ game variables are and that they store values that represent the objects in our games it is probably obvious that these values held by our variables will need to change […]

C++ condition checking in a game

Condition checking in games is all about making decisions. How do we know the player has run out of lives? How do we detect the ball has reached the edge of the screen […]

Structuring and branching the code

We have seen in the last tutorial how we can detect certain conditions in our C++ code. For example when the player loses a life, destroys an alien or gets a new fastest time. We […]

Loops in the game code

Loops might sound a bit odd at first? They are a way of executing parts of our C++ code more than once, looping over code until we have the result we want or a test is done. This can […]

Organizing C++ game code with functions

Functions are a really vital part of C++. They serve a number of, well, functions. They allow us to make our code more readable and manageable by splitting it up into parts, called functions. They […]

Introduction to OOP for C++ games

Object Oriented Programming OOP, is how most programming is done these days. While it is possible to code a game without using it and many games in the past were, even the most simple game […]

Handling game data with C++ arrays

C++ arrays do exactly what their name implies. They allow us to handle whole arrays of data in one simple structure. Certainly, there is quite a bit to learn about arrays but actually they are […]

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 […]

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 […]