C++ game coding tutorials
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 also allow us to avoid duplicating our code. For example, if there is something we need to do more than […]
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 projects will benefit greatly from using OOP. So what exactly is it and how do we get started using OOP? […]
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 very straight forward as we we will see.
What exactly, is an array?
If a variable is a box in […]
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 […]
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 […]