I am atempting to make a very cheesy game with what I know so far. It is just a very simple texted based rpg. But I want the user to be able to save there progress. How do I do that. I am using varaibles for almost everything.
Thank you!
I am atempting to make a very cheesy game with what I know so far. It is just a very simple texted based rpg. But I want the user to be able to save there progress. How do I do that. I am using varaibles for almost everything.
Thank you!
For the duration of a given session use an appropriate container (array/vector, list, etc). For use of information from one session to another, use files.
Look up ifstream and ofstream.
alrighty....I'll try.
There's lots of different ways to save games. One is to take every last (important) variable in the game, i.e. position, level, number of enemies, each enemy's position and other info, etc. and write it to a file via ofstream, or in other words take a virtual 'snapshot' of the game that you can load at some other time. However, that's prone to abuse (snapshot right before a tough spot, load every time you screw up, snapshot after you've passed). Another is to just save the current level and player attributes, and have them start at the beginning of the level when they load a saved game... But that can be frustrating when you're almost at the end of a level and you have to go.
The general idea is just to find some way to let the player continue from more or less where they left off, and how you do that is completely up to you as long as it works, and even that's up to you
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
There are also considerations about how easy it is for the user to synthesize a saved game by cracking your file format, but for the most part you just need to learn about file i/o. Data processing can be worried about later.
1024-bit encrypted, zipped, encrypted twice and zipped again in another formatThere are also considerations about how easy it is for the user to synthesize a saved game by cracking your file format
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.