That's what I've been asking myself since I read the criteria for selecting featured games. I'm talking about this, specifically:

Quote

Installation: +1 point if the game installs and uninstalls correctly

I wanted to add achivements to my game (like the ones in PS3/XBox games) and I thought about writing a text file and save the progress of the player and the amount of trophies earned in that file. But the thing is that that file would be created in the same directory as the .jar (or any other folder) and if you wish to delete the .jar then the savegame file will remain there (duh) unless you delete it as well. Then I thought that I could simply create a file or modify an existing one within the .jar, and update it while in game. A quick google search on how to do that made me realize that it was too difficult/impossible to do.

I could also use an installer and then the uninstall would take care of the problem of deleting the .jar and the savegame files for the user, but the question remains the same:

Is it possible to create a savegame feature in a game deployed trough an executable .jar while not creating extra files for that purpose?Thanks!

But, wouldn't you have to manually delete the game folder after deleting the .jar?

Perhaps I didn't explain very well what my question was (not being a native English speaker doesn't help either). Basically what I'm asking is if there's a way to save the state of a game packaged in an executable .jar without creating any other aditional files. And of course, without uploading the data to a server or something like that.

Don't forget to put a '.' before the folder name so it would be invisible on Linux so if your game was to be named MyAwesomeGame, the folder would be '.myawesomegame'

The '.' works on UNIX-based systems, so it will work on Mac OS X as well. So I'd just do getDataFolder() + ".gamename". Also, you can hide the folder on windows using this (this method will also work for UNIX based systems):

Using only one JAR file as an "executable" file is a bad idea, I already explained it several times on this forum. Unfortunately, on lots of machines, the OS will try to open your JAR with an archiver, it won't run your game when double-clicking on the JAR. For example, Winzip and WinRAR will do that by default under Windows, Ark will do the same under some GNU Linux distros. I advise you to use another solution like Java Web Start (very easy, allows you to use your JAR but a bit buggy), IzPack (very complete, very professional) or GetDown.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org