Copy link to clipboard
Copied
I'm currently making a game with over 100 levels. I have a level select screen where you can go to any of the 100 levels.
I want it so that only level 1 is unlocked first then when you beat it level 2 unlocks and so forth.
What's the best way to go about this?
I was thinking an external text file maybe like this:
Level1:Unlocked:UnBeaten
Level2:Locked:UnBeaten
Level3:Locked:UnBeaten
and so on
then when the levels are unlocked and beaten updating the text file. Is this possible?
Even making a class which stores level variables including beaten and locked.
I'm just not sure what direction to head in. A little guidance would be much appreciated.
Copy link to clipboard
Copied
you can use the sharedobject to store the last beaten level.
Copy link to clipboard
Copied
Thanks for the reply kglad. I'm trying to use a sharedobject but I cant find its location to see if it worked.
I'm running xp and I understand it should be at:
c:/Documents and Settings/username/Application Data/Macromedia/Flash Player/#SharedObjects
but I don't have anything in my Flash Player folder.
Here is my code:
var so:SharedObject = SharedObject.getLocal("location");
so.data.saveMe = dataToSave;
so.flush();
I used a trace:
trace(so.data.saveMe);
which returned the correct value
How do I check to see if its working? Thanks.
Copy link to clipboard
Copied
The LSO is encrypted so you won`t have luck reading it directly out. It`s even hard to erase, you have to right-click on the flash player and set its storage amount to 0KB (default is I think 100KB). But that means also that its probably no good choice to store your information, since the user that has it set to 0K won`t be able to get to your 2nd Level.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more