Save directory
Hey, I'm making a game in java at the moment and I'm making some saving / loading functions. I'm just wondering. Where should i put all the saved settings and game-saveings files?
These two directorys are the ones that I minded up to save the files in, oh and let's say my game's name is "unnamed".
new File(FileSysteView.getFileSystemView().getHomeDirectory(), ".unnamed");
new File (System.getProperty("user.home"), ".unnamed");
Or, where do you think?
I propose to create a separate directory "dist" were you create a subdirectory "data" . This subdirectory will contain your game-data.
In dist-directory you store your JAR file myGame.jar . To distribute the game you just have to zip the the dist-directories content to a zip-file and then sent it to the world! The end-user can store/unzip the application were he wants.
In your code you use f.e. this method to fill the file path in io - actions.
System.getProperty ("user.dir") + "\\" + "data" + "\\" + "unnamedFile" .
In a readme.txt file you explain the user that when he wants to get rid of the game he has to delete the JAR file and the data file at the unzip-location.
I'm not a great Java expert but I've solved the problem that way in my code.