Diablicolic Posted August 4, 2003 Posted August 4, 2003 I'm creating a game, and I want the user to be able to Save the game. And I only want 1 Save Slot. Now how could I save the players position (just what stage that person is in. aka: 1 or 2 or 3) and then save that information within the .exe without creating a saved file within the application's directory inside of the user's computer? Quote "Reality is fake, Dreams are for real"
Diablicolic Posted August 4, 2003 Author Posted August 4, 2003 Oohhh I guess I can save it in a saved file :rolleyes: But how would I go about doing that? I only want like 1 integer in the saved file to understand where the person is at in the game :p Quote "Reality is fake, Dreams are for real"
*Experts* Volte Posted August 4, 2003 *Experts* Posted August 4, 2003 You might want to look into using XML Serialization. That way you could create a GameState class or something, store the current level, score, and anything else you want to save, and simply serialize it into an XML file. Then you just deserialize it back into a GameState object when you are ready to get the data again, and use the properties of the class. Look in the MSDN for information about XML Serialization for that. However, if you just want to save it in a file, there are many examples in the MSDN as well. Look for the StreamReader and StreamWriter classes, as well as the System.IO namespace. Quote
Diablicolic Posted August 4, 2003 Author Posted August 4, 2003 Cool, I got them all down on my notes, thanks a bunch Volte :p Quote "Reality is fake, Dreams are for real"
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.