- Home /
2d paltform game with lot of stages
Hi..I am making a 2d platform game with about 30 levels/stages. I want to be able to see the stages like the image below. I want to pass the first level to go to the next,after that,pass the second level to go to the next etc. And i want the lock also to be in front of the image of every level and cant access it if you didnt passed the previous...
Are there any tutorials to make this??
I dont know where to start. Thanks.!!!
Answer by equalsequals · Jul 16, 2010 at 02:28 PM
Levels are nothing more than Unity's Scenes. You can use Application.LoadLevel() to move from one Scene to another, and thus one level to the next.
As far as implementing locked levels, you'd need to make use of PlayerPrefs storing boolean data for each level for whether or not it is currently unlocked.
When the user completes level 1 you'd make a call to your PlayerPrefs to unlock the next level in your game.
In your level select menu you would simply check for that same PlayerPrefs boolean that you created earlier, if it is unlocked you make the button interactive and don't draw the lock graphic ontop of the button, otherwise just draw a texture with no interactivity.
Hope that helps.
==
ah i undestand but i have another idea and tell if its true. I will use the if/else.
"level1" Application.Loadlevel (1); "level2" Application.Loadlevel (2);
You have 0 points.To go to "level2" you must have 100 points.Every level gives you 100 points.
If you passed level1 then points=100 And you can play the level 2
Can i do this with points?
And when you want to go to level20 without pass any stage it will print "You must have 2000 points to play the level20".
If you have a point based system, just keep track of how many points have accumulated in PlayerPrefs using SetInt(); Then do a check if the next level's requirement is met by checking how many points you have.
Your answer
![](https://koobas.hobune.stream/wayback/20220613064941im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unsmooth camera on sprite diffuse 0 Answers
How to make a simple "That's all folks!" effect in 2D? 1 Answer
Material is destroying sprite`s quality 1 Answer
Android Build has bad quality 0 Answers
2D side-scrolling Level Design 3 Answers