Its not too tough to do, I'll try and walk you through it.
You want to make a global variable for your lives. Make sure to make this one inside game editors built in variable creator. When you create it be sure to fill in something for the save group. For this example I am just going to use "lives" as the variable and "lvlstart" as the save group.
Put this in your level end code:
- Code: Select all
saveVars("game.sav", "lvlstart");
This will create a save file int he main directory of your game called "game.sav" You can actually call it whatever the heck you want. The second argument is what save group you want to write in the game.sav file or which group you want to update if there is already a file present. In my particular game I have bombs, lives, and weaponstate as part of the save group "lvlstart."
When your new level starts, all you have to do is write a code to load the saved variables... just put:
- Code: Select all
loadVars("game.sav", "lvlstart");
This will simply update all the variables in the save group to what they were previously saved as in the save file.