This site requires JavaScript, please enable it in your browser!
Greenfoot back
ItsJosh18
ItsJosh18 wrote ...

2016/3/17

How to save game

ItsJosh18 ItsJosh18

2016/3/17

#
I would like to save the variables and the would in which the player is in and then load it after reopening the Jar. How would I be able to do that?
danpost danpost

2016/3/18

#
You could write to and read from a 'txt' file. You would need some trigger (a specific keystroke or a clicked button) for the user to initiate the saving process. The loading process could be automatic during your first world construction; but the file will need to be created before a transition from a strictly code created world to a world create via the file; or the loading process could be triggered by the user also (again, by a specific keystroke or click). Now, you need to attempt to code something that will do what you require. Go one step at a time. If you have issues with a specific step, then post your attempted code, explain your issue in detail, and ask for help here.
ItsJosh18 ItsJosh18

2016/3/18

#
Cool thank you.
You need to login to post a reply.