Search code examples
iphoneif-statementcocos2d-iphone

Targeting Multiple Scenes


I have a scene that is displayed before a level, where the images are loaded. During this I show text about the game. I would like the text to appeal to what Level it is. How can I do something like "if Level is 5-9", and then the rest of the code.

Basically my way of explaining is:

       if (currentLevel.Level 5-9) { 
//do stuff 
    }

By Level5-9 I mean Levels 5, 6, 7, 8, 9. Tell me if you need more explanation.


Solution

  • if (currentLevel >=5 && currentLevel <= 9) { 
        // do stuff 
    }