How to make an achievement system?

Started by Sayhello-hello, Mon 27/09/2010 14:08:29

Previous topic - Next topic

Sayhello-hello

Hi,

I haven't actually gotten any code down. But I was wondering how one would go about making an achievement system.
I thought about making some booleans and then set them to true once you've unlocked an achievement, but once you restart the game I suspect the achievement would be lost, and it's a game where you DO need to restart.

Or should I "manually" make the game restart, so that it just seems like it's restarting but in code, it's actually not?

tzachs

If you play, and then restart your computer and play a new game, do you need your achievements to stay?

If you don't, then your way should work fine (with the "manual" restart).

If you do, then you should save your acheivements to a file, and load them manually each time you start a game. You can search the manual for file handling functions, or use a module, there are a few here that handle files...

Sayhello-hello

I haven't actually thought about whether it should have an effect if you restart the computer, only the game. So thanks for pointing that out to me.
I guess the manual restart would be the best then, in case of new users or you just want to start all over, since it's a short game.

SMF spam blocked by CleanTalk