#include "MAP.h"
#include "PLAYER.h"
#include <cstdlib>
#include <ctime>
#include <iostream>
usingnamespace std;
int main()
{
srand( time(0) );
Map gameMap;
Player mainPlayer;
mainPlayer.createClass();
//begin adventure.
bool done = false;
while (!done)
{
gameMap.printPlayerPos();
int selection = 1;
cout <<"1) Move, 2)Rest, 3) View Stats, 4) Quit: ";
cin >> selection;
Monster* monster= 0;
switch(selection)
{
case 1:
//Move the player.
gameMap.movePlayer();
//check for a random encounter. this function returns a null pointer if no monsters are encountered.
monster = gameMap.checkRandomEncounter();
//monster not null, run combat simulation.
if ( monster != 0)
{
while (true)
{
mainPlayer.displayHitPoints();
monster->displayHitPoints();
cout << endl;
bool runAway = mainPlayer.attack(*monster);
if (runAway)
break;
if(monster->isDead() )
{
mainPlayer.victory(monster->getXPReward());
mainPlayer.levelUp();
break;
}
monster -> attack(mainPlayer);
if (mainPlayer.isDead())
{
mainPlayer.gameover();
done = true;
break;
}
}
/* the pointer to a monster returned from
check random encounter was allocated with "new"
so we must delete it to avoid memory leaks*/
delete monster;
monster = 0;
}
break;
case 2:
mainPlayer.rest();
break;
case 3:
mainPlayer.viewStats();
break;
case 4:
done = true;
break;
}//end switch statement
}//end while statement
}//end main function.
it just doesnt recognize my headers even if i got them opened in an another tab in the same project...
the error reported is. fatal error C1083: Cannot open include file: 'Map.h': No such file or directory!!
If you've set an include directory (specifying the location of your headers) within your project (assuming this is a project), then you need to replace the quotation marks with angle brackets.