Author Topic: Saving in-game data  (Read 1898 times)

Micboy

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-2
    • View Profile
Saving in-game data
« on: January 19, 2013, 02:29:23 pm »
Is there an easier way compared to using 'File Open' etc e.g. writing code in appexit()?

Also, what would one write in appexit()? (generally)

Thank you for taking your time to read this post!

DeadSn0wMan

  • Guest
Re: Saving in-game data
« Reply #1 on: January 20, 2013, 09:17:14 am »
To answer your second question:

It's not really nessesacry to write anything at all in the AppExit function unless your app needs to do something when you kill the app completley(meaning not just pressing the home button, removeing it from the multitasking menu). If you want something to go off everytime you close the app with the home button you use the SuspendInit() function.

I only use the App exit curretly to remove memory from the heap. Like if I dynamicly allocated memory I need to delete them so I don't get a memery leak. But if you just use regular variables you don't need to worry about the AppExit. You can also use app exit to delete pointers.

Micboy

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-2
    • View Profile
Re: Saving in-game data
« Reply #2 on: January 23, 2013, 02:42:13 pm »
To answer your second question:

It's not really nessesacry to write anything at all in the AppExit function unless your app needs to do something when you kill the app completley(meaning not just pressing the home button, removeing it from the multitasking menu). If you want something to go off everytime you close the app with the home button you use the SuspendInit() function.

I only use the App exit curretly to remove memory from the heap. Like if I dynamicly allocated memory I need to delete them so I don't get a memery leak. But if you just use regular variables you don't need to worry about the AppExit. You can also use app exit to delete pointers.

Thank you for the clarification! What do you think is the easiest way of storin in game data?

zacho

  • Jr. Member
  • **
  • Posts: 81
  • Karma: +2/-0
    • View Profile
Re: Saving in-game data
« Reply #3 on: February 28, 2013, 10:59:28 pm »
The easiest would be to write to a file using the file commands in this order: (I have built functions around the dragonfiresdk functions but this is what I call):

File create.
Get file handle
Set cursor (not all the time, it's not necessary for my app)
Write to file