[SOLVED]Saving Game Possibiliy in Qt question
-
Hi everyone... Is it possible to have my game a saving option? and load it afterwards? I'm working on my game right now and the idea of saving the game if not finished comes on my mind... SO is it possible? How?? Can you please give me a link or teach me how to do that?
I use javascript and QML for my game. ..
Thanks guys
-
It is not possible from JS AFAIK, but you always can use C++ backend.
-
Maybe this will help:
http://doc.qt.nokia.com/4.7-snapshot/declarative-sqllocalstorage.html -
Not sure that sqlstorage is something needed for saving. In this case I'll add couple of methods in C++ part and will invoke them from QML. Not hard, really.
-
Look "here":http://doc.qt.nokia.com/4.7/qml-extending.html and maybe "here":http://doc.qt.nokia.com/4.7/qml-extending-tutorial-index.html .
In couple of words. The easiest solution for you will be to add QObject subclass to your project, add couple of slots (or Q_INVOKABLE methods) there and set its instance as context property for your declarative engine.
-
Format choise is up to you :) If you need to store some tree data or you want to edit it in your text editor later or you just need non-binary format then xml is ok.