I've set up the following Variable on both levels
SaveLevel
Integar
Global
Array: no
Save group: data
Level01 I set up the following:
Global script
- Code: Select all
int level;
Collision - script
- Code: Select all
level = 2;
SaveLevel = level;
saveVars ('game.sav", data");
Score screen I set up
Global script
- Code: Select all
int level;
int loadlevel;
Keydown - script (to start the level)
- Code: Select all
loadVars ("game.sav", "data");
level = SaveLevel;
if (level = 2);
strcpy("loadlevel", "level02.dat");
if (level = 3);
strcpy("loadlevel","level03.dat");
if (level = 4);
strcpy("loadlevel","level04.dat");
LoadGame("loadlevel");
I set up a Text Actor to see if "level" did in fact = 2 and it does, so the var code is good.