+ 2
How would i go about saving variables from a java program to be used the next the program is launched? I want to make games.
3 Antworten
+ 9
This would require use of files or databases. You could write to a file/database when the player saves, and/or implement autosaves, that trigger at certain times or events.
Most games encrypt their savefiles or at least hide their extensions, but I wouldn't worry about that yet.
There's three lessons on files here for Java. Here's the first one: https://www.sololearn.com/learn/Java/2186/
Keep in mind, if you want to practice in the Code Playground, you must keep recreating the file every time at the start of your program, before you work with it. The servers will not save your files.
+ 6
Yes, you would, as well as how Java handles them, and whether to use local/external databases
+ 1
when working with databases would I need to learn SQL?