Can anyone give me a hint on how to save my heroes health that is in a PLAYER class that would be GetHealth() because it inherited that from the base class entity.
SetHealth() is in the base class Entity. I know I am just a couple line away from solving the problem. If you guys need more info let me know. I'm thinking this is enough code though...
void save()
{
//save player name, life, and current coordinates on the board
ofstream saveGame;
saveGame.open("save.txt");
saveGame << playerName << " " << player.GetHealth() << " " << x << " " << y << " "
<< m << " " << n << " " << g << " " << h << " " << Currentroom << endl;
saveGame.close();
}
void continueGame()//I think my problem is here...
{
//open save file for previous matrix position and health
ifstream continueData;
continueData.open("save.txt");
continueData >> playerName >> player.GetHealth() >> x >> y >> m >> n >> g >> h >> Currentroom;
continueData.close();
}