Hey Everyone,
Ok, so i have windows 8 and i have a mac also. When i play my game on the mac and windows 8 it creates the files perfectly without fail. But for some reason my friend who has windows vista home premium seems to be having a problem when he plays it. It’s not creating the saves folder with a save.txt file it. Like it said it works on all my computers. Is this a problem with him using windows vista? his java is up to date and everything.
Here is the code i’m using to create the files. Maybe someone could help me fix the problem if it can be fixed
public static void saveGame(String path){
try{
File theDir = new File("saves");
if (!theDir.exists()) {
boolean result = theDir.mkdir();
if(result) {
System.out.println("DIR created");
}
}
File file = new File(path);
FileOutputStream fo = new FileOutputStream(file);
ObjectOutputStream os = new ObjectOutputStream(fo);
os.writeBoolean(lvl1Complete);
os.writeBoolean(lvl2Complete);
os.writeBoolean(lvl3Complete);
System.out.println("Game Saved.");
os.close();
}catch(Exception e){
System.out.println("Could Not Save Game!");
throw new RuntimeException(e);
}
}
Thanks
- GlennBrann