PDA

View Full Version : Qt game with levels and saving the state!



nilan
23rd June 2016, 15:26
hi,
I'm trying to make a game with Qt/C++. everything is ok, but now I want to have 2 levels in the game. and the other thing I want is the ability to save and load the game. I mean playing the game after awhile from the state that it was last time.
the game is plants vs. zombies. everything is like that and in the second level just type of zombies are different. I think I should use files for this stuff but i don't know what the format should be and what should I write in file?

jefftee
24th June 2016, 07:13
That's entirely up to you of course. Typically you would load/save all of the state variables you would need in order to continue exactly where the player left off. e.g. player name/number, position, score, level, health, money, list of acquired items, and on and on.

You can load/save this info to/from files, ini settings, xml, json, etc. No real standard exists, so it's entirely up to you!

nilan
24th June 2016, 12:59
yes, thanks!
i want to use CSV or JSON but i don't know what is json :-"" and how should I use it?

jefftee
24th June 2016, 15:30
If you don't know what JSON is, then I'd advise you to stick with CSV. You can google JSON of course, but if you're just starting out, you might want to focus on the programming and logic for your game, rather than spend time on something that the user doesn't really care *how* it works, only that it works!

Good luck.