I have developed a ios game with 20 levels.
I have menu at starting screen which has 20 buttons for 20 levels.
What i need is ,For example If user dont finish level 1 level 2 button should not be enabled ,and so on.as user finish some levels in game the next level should be enabled.
I know its very basic and this is my first game in ios.So please be gentle,Any ideas will be appreciated thanks. 🙂
Note : my game is fully cocos 2d .any idea in cocos2d is good 🙂
Create all buttons using “custombutton” class.set BOOL variable in that.
while creating buttons set btn.is_level_completed = NO;After completing every level set btn.is_level_completed = YES;After that check in viewwillappear and change image for completed levels.
to store the data
set tag value for buttons(like 1,2,3…) and while completing the level store the tag value in NSUserDefaults using the following code,
in viewWillAppear get the completed level and change the images for buttons.