you have to save the state of the game when the user closes it. in windows programming term it is called serialization. i.e. writting the state of application to a text file in some format and when the application again starts it reads the state from that file.
i give you an example: lets say you have a drawing program and a user has drawn two things on the sheet. A line and a rectangle.
line has cordinates (0,0),(50,100) and the color is red.
rectangle has cordinates (101,101),(200,200) and the user exists the program.
lets say i have a data structure like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
typedef struct SHEET_INFO
{
int start_x;
int start_y;
int end_x;
int end_y;
int color;
}SI;
SI line1;
line1.start_x=0;
line1.start_y=0;
line1.end_x=50;
line1.end_y=100;
line1.color=RED; //RED might be a defined type
|
now you just have to write "line1" to the file and similarly for the rectangle. now when the user opens the file again it will read the info sequentially and draw the sheet again to continue the painting. correct???
this way you need to see what all you have in your game which should be stored, implement your data structures and save this to your data file.
i hope this info will be useful...