2

I'm creating a game where the player can unlock worlds, where they can unlock levels within those worlds, each levels has a highscore, and so on.

I was wondering in which way should I store this data? I was originally thinking of making a number of separate plist files, but that seems like an approach which could end up spiralling out of control.

Has anyone approached this problem and come up with a decent solution?

2

Most apps like that store data in a SQLite3 database rather than property lists. I recommend this route instead—actual implementation/etc is off-topic here.

2

I think a good approach would be to save each world under a category, and saving the information for each world. For example:

<dict>
    <key>Worlds</key>
    <dict>
        <key>TheLand</key>
        <dict>
            <key>WorldIsUnlocked</key>
            <true/>
            <key>Highscore</key>
            <string>1304</string>
            <key>Levels</key>
            <array>
                <key>level1</key>
                <true/>
                <key>level2</key>
                <true/>
                <key>level3</key>
                <false/>
            </array>
        </dict>
    </dict>
</dict>

This way, you can easily point to whatever piece of information you want.

E.g extracting the highscore of the world "The Land" Worlds -> TheLand -> Highscore, will print out: 1304. Checking what levels are available within "The Land" Worlds -> TheLand -> Levels, will print out an array: level1: true, level2: true, level3: false.

On a side note, this question is more programming related and should therefor be asked over at stackoverflow.

Not the answer you're looking for? Browse other questions tagged .