Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am learning a cocos2d based Game template tutorial from here and now I am at this point of the tutorial. My question is, how can i run 30 different scenes in 30 different levels of 5 chapter? Now I am using this

switch (gameData.selectedLevel) {

    case 1:

    [SceneManager goChapter1Level1Scene];

    break;

    (... snip a whole lot of lines...)

    case 30:

    [SceneManager goChapter5Level6Scene];

    break;

    default: break;

}

in the "- (void) onPlay: (CCMenuItemImage*) sender" method. But it work only for 6 levels scene of chapter1. Other 4 chapters levels are show as same as 1st chapter levels scene. they are not show their own level scene. can any one please teach me, how can I do this stuff using this game template?

share|improve this question
2  
Just a code comment: If you have 30 different methods where the only difference is the numbers they take, and you're not doing goChapterLevel(5, 6) you either know exactly what you're doing or you're doing something horribly wrong. –  doppelgreener May 20 '12 at 1:25
3  
I would love to know the case for "know exactly what your doing". Seriously, I would. –  nycynik May 20 '12 at 3:31
    
@nycynik On second thought there probably isn't one. –  doppelgreener May 20 '12 at 4:35
    
That makes me feel better :) TY –  nycynik May 20 '12 at 14:36
    
First four words of your question aren't actually needed, I suggest that you try to make your question titles less verbose and more concrete. Just my opinion... –  jco Jul 19 '12 at 14:04

1 Answer 1

It's a total guess here, but it seems like your calculation of selectedLevel might be wrong. How are you calculating it? Is it someting like Chapter*Level? I would check that your not just sending level, and so when the chapter changes it fails to change.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.