The Gladiator source (.cpp) file
Because source files always contain more than 20x more code than the header files, I would like to follow a different approach here in explaining the code. I will break down the source file into blocks, one by one.
The includes
As we mentioned earlier, any C++ file or even header file must start with the include
statements. You don't have to include everything; some of the include
statements will be there by default but others might be needed while you are building up the code.
Even if your game example is different and you wanted to have different functionalities, you might need to include more headers.
#include "Bellz.h" #include "Gladiator.h" #include "GameDataTables.h" #include "PaperSpriteComponent.h" #include "GameDataTables.h"
As you can see, now the included header files have been increased to include those we have formed from the auto-generated source file.
Because the game will be reading data from...