Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Making a Game with multiple levels

Guest
Feb 10, 2011 Feb 10, 2011

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.

TOPICS
ActionScript
821
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 10, 2011 Feb 10, 2011

you can use the sharedobject to store the last beaten level.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 13, 2011 Feb 13, 2011

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.



Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 14, 2011 Feb 14, 2011
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines