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];


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

    case 30:

    [SceneManager goChapter5Level6Scene];


    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?

  • 2
    \$\begingroup\$ 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. \$\endgroup\$ May 20, 2012 at 1:25
  • 3
    \$\begingroup\$ I would love to know the case for "know exactly what your doing". Seriously, I would. \$\endgroup\$
    – nycynik
    May 20, 2012 at 3:31
  • \$\begingroup\$ @nycynik On second thought there probably isn't one. \$\endgroup\$ May 20, 2012 at 4:35
  • \$\begingroup\$ That makes me feel better :) TY \$\endgroup\$
    – nycynik
    May 20, 2012 at 14:36
  • \$\begingroup\$ 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... \$\endgroup\$
    – jcora
    Jul 19, 2012 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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .