Newbie in need of help

Started by
2 comments, last by mittens 15 years, 8 months ago
Hi, I''m currently making a game. And I need help. I am writing it in C++, and I need to know how to program a "game saving" feature into my game. Any help would be greatly appreciated. Thanks! ------------------------------ The Shining Knight
Advertisement
To save a game you need to save all of the variables needed by your engine to know the game''s current state, so it can load it back and everything will be the same. Take an example of packman, you might need to save the following:
- the player''s position and direction
- the monster''s positions and directions
- the blips that have been eaten
- is the game in "big blip" mode (packman eats the monsters)
- AI state of the monsters
etc.

Basically you need to take the values of everything in the game as it is, and save it to a file (using fstream for example).

Hope that helps,
Frank
Hey frank, do you know how to error check on fstreams? Saying I try to load in 5 strings, but there''s only 2. And then I wanted to fill the 3 that weren''t there with just zeros or something. Thanks.

~WarDekar
Thanks FrankD that helped a lot!!!

------------------------------
The Shining Knight

This topic is closed to new replies.

Advertisement