What are those header files (.h) ?
This tutorial is for all those starting learning C++. If you are a developer you will find this a bit boring.
Next we can see the first lines of the main file (main.cpp) of the game written in C++.
#include "allegro.h"
//#include "allegro5\allegro.h
#include <time.h>
#include <stdlib.h>
#include "protagonist.h"
#include "enemy.h"
#include "environment.h"
#include "induction.h"
#include "common.h"
#include "indicators.h"
"protagonist.h", "enemy.h" are called header files.When the program we want to make is large enough it is much better to structure the code in several files not only one.So we will have several header files and their correspondents .cpp files. In the header files we will declare data members (variables) and methods (functions) whereas in the .cpp files we will define them.The "include" directive just copy and paste the file. That's all.We will use " " for all those header files that we code. (e.g. "#include "protagonist.h"). I wrote that file so I use " ".
We will use < > for those belonging to other libraries like the standard library of c++, allegro, etc (e.g #include ). I did not write that file for the game so I use < >.
How is structured the game?
In the header file "protagonist.h" I have the class protagonist which contains all the data member and methods that determine characteristics and behaviour of the protagonist, the character you can see in the middle of the screen.In the header file "enemy.h" I have the class enemy with all the data members and methods that control the guards.These two are the main parts of the program so far.
What is next?
I think that this is a good game to follow for all of you who are learning coding because it is coded from the scratch without game engines. In other tutorials I will keep on explaining other parts of the code.