Click to See Complete Forum and Search --> : Storing Variables...


yellowTIGER
May 22nd, 2001, 04:59 PM
hello,

I'm making a game, and was wondering how to make 'save files' to store some variables.
thanks for any help/code.


--yellowTIGER--

Tower
May 22nd, 2001, 07:31 PM
That type of your data?
String or bin?

Iouri
May 23rd, 2001, 07:43 AM
You can use ini file.

Iouri Boutchkine
iouri@hotsheet.com

Kdev
May 23rd, 2001, 08:28 AM
You'll need to consider whether or not you want some or all of these variables accessible to the user. If you will be storing information like lives left and score you will not want to write this data as mere text in a file else the user will be able to edit this.

You can always just open a file for output in binary and store bytes of data rather than the actual ascii codes. You can have a data-block say 1024 bytes or however many you need. Then you just write the bytes (maybe even use some sort of offset to help encode the data) in a certain order so that you can read it back in. Perhaps use a check byte as well to validate the data.

Hope this makes sense.

-K