|
Stars: Set a variable counting the number of stars you already collected. If variable stars is equal or larger than (for example 5), go to the map room and set a global alterable value (maybe want to call it something like Level X opened) Example:
| CODE | Go to frame Map Set Global Alterable Value A (Level 2 opened) to 1 |
On the Map frame, perform a check if "Level 2 opened" equals 1. If it does, allow the player to enter the level, otherwise don't. Simple as that.
Your best bet on saving things would be simply using a save file. Like you'd just take your Global Values and write them to a file. Let's call it gamesave.sav.
gamesave.sav would look like this right now:
| CODE | lives=5 totalstars=5 level2opened=1 |
If you keep it like this, people could easily edit the savegame, so you might want to encrypt it using the Blowfish extension.
On the load file event, check for each variable and read out its value.
| CODE | Set Global Value Lives to (lives variable in savefile) Set Global Value Total Stars to (totalstars variable in savefile) |
Go on. Actually you're just transferring variables from the game to a file for saving and vice-versa for loading.
--------------------
|