I have programmed a couple of command line adventure games before but never used classes to do so. So I thought it might be easier to use classes, but I have a funny bug with my mob generator at the moment. Every time I use say 'mob().name' to find the name of the generated mob it changes it so I have the health of one name of another and attack of another!
You can not call constructor directly...like player();
you have to create instance of class Player. Player player;
it will automatically call your constructor..
Than by using that instance you can access your any member..
like, cout << "Stats" << endl << "Health: " << player.Health << endl << "Attack: " << player.Attack << endl << endl;
Similarly for other other class..
Each time you call, for instance, mob(), you are creating a temporary, unnamed mob object, and calling the constructor. So, lines 11, 18 and 30 refer to 4 different player objects, lines 19, 20 and 21 refer to 3 different level objects, and lines 22, 23 and 31 refer to 3 different mob objects.