Is there a command to see if a file exists?
When my game first loads to the main menu I want to say:
If savefile exists then load it
if not assign these values to variables
if(fopen("savefile.sdg","r+b"))
{
//File exists
}
else
{
//File doesn't exists
}
const int maxlevels = 3;
int BLevelComplete[maxlevels]; //This array needs to be saved
int LevelX[maxlevels] = {960,-320,320};
int LevelY[maxlevels] = {-720,-240,-240};
Jagmaster wrote:So, is sdg the extension for a saved variable file?
foleyjo wrote:Cheers gogo.
1 question about that - What exactly does the r+b bit mean?
Also I just realised the array I wish to save I have set up in the global code and not used the variable option in game-editor. I'll explain why with the section of code
- Code: Select all
const int maxlevels = 3;
int BLevelComplete[maxlevels]; //This array needs to be saved
int LevelX[maxlevels] = {960,-320,320};
int LevelY[maxlevels] = {-720,-240,-240};
How would I go about saving this? Would I need to recreate it using the Variable option.
(on a different note I keep pressing the + to give you a point but all it is doing is refreshing the page)
Users browsing this forum: No registered users and 1 guest