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

2013/12/23

Saving within Greenfoot

Mimagic Mimagic

2013/12/23

#
Ive read loads on this but cant seam to get a straight answer... Im creating a game for college and i wanted to know if there is a way in which i am able to save variables to an external source file. upon launching greenfoot and within the game the user is then able to load a save file to a previously saved game... is this possible ? (This is not essential to my college work, i was just wondering..)
Gevater_Tod4711 Gevater_Tod4711

2013/12/23

#
Of course this is possible. When you are playing offline you can save all the information you want in files on your computer. If you are playing online (on the greenfoot webside) you only have the UserInfo which only has a fiew strings and ints you can save but you can also save things there (like highscores). If you want you can use my File Reader/Writer (demo) scenario to save and load files. The scenario includes some methods for easily saving and loading strings into files. Just download it and copy the neccessary methods.
danpost danpost

2013/12/23

#
Except for on the Greenfoot site (which, due to security issues, is not possible at all), writing files should not be a problem.
Mimagic Mimagic

2013/12/23

#
Thanks guys, merry Christmas to you both :D
You need to login to post a reply.