hey i need to load the contents of a file in this format
into several variables..
i got the saving working properly.
i have this code but it doesnt work
Code:
int load_game( void ){
FILE *savegame;
int battle_num = 0;
int awake;
int hp = 30;
int att = 5;
int def = 5;
int spd = 5;
int power = 5;
int wins = 0;
int loses = 0;
int cash = 100;
savegame = fopen("streetfighting.sav", "r");
if( savegame == NULL ){
printf("\n\nNo previously saved game...\n\n");
main();
}else{
fscanf( savegame, "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d", hp, att, def, spd, power, cash, wins, loses, awake, battle_num );
printf("\n\n...LOADED...\n\n");
menu( hp, att, def, spd, power, cash, wins, loses, awake, battle_num );
}
}
thx