How to save a game

Feb 15, 2013 at 2:02am
I made this game but what I want to do now is save it so I can come back and play it again, but I do't know how to do that so if anyone can help then thanks.
Feb 15, 2013 at 2:14am
Save whatever info you need into a text file and then just give the option to load all of the info from that file the next time you start (the type of data depends on the game obviously).

http://www.cplusplus.com/reference/fstream/fstream/
Feb 15, 2013 at 2:17am
Write the state of the game to a file. When the user restarts the game, load the file to restore the state of the game. Pretty straight forward if you're using classes.

For example, if you have a Game class along with two Player instances, simply write those three objects to a file. When you restart, initialize the Game class and the two player instances from the data saved in the file.
Feb 15, 2013 at 2:20am
thanks !
Topic archived. No new replies allowed.