PDA

View Full Version : [SOLVED] Java videogame, how to save a game?



Diabolis
October 17th, 2007, 01:45 AM
I'm building a videogame with java. I need to have a save/load option, so I can leave the game and and then continue any other day. The most obvious answer is to pass all the info to a text file. But someone told me that maybe I could just save the current status of the memory used by my game at that moment or something like that, so I wouldn't have to worry about formating a text file. Anyone knows if this is possible or at least is there any other alternative to the text file? The game has lots of different objects moving around the screen and I think it would be very difficult to make a text file that would save every object. So any suggestions?

Edit
The answer is serialization
http://forum.java.sun.com/thread.jspa?threadID=5226869