can we actually be able to "save" our game before quiting ?
For example, the score that we have made and all the levels that we have already accomplished...our variables also...
and resume our game later ?
int lives = 0;
void saveLives()
{
FILE *arq = fopen("lives", "wb");
if(arq)
{
fprintf(arq, "%ld", lives);
fclose(arq);
}
}
void loadLives()
{
FILE *arq = fopen("lives", "rb");
if(arq)
{
fscanf(arq, "%ld", &lives);
fclose(arq);
}
}
int lives=0;
Users browsing this forum: No registered users and 1 guest