Issue with selecting level form Level Selection screen (Cocos2d + box2d) -


The level selection screen is started based on the menu items and the selected item level ... here is the code. Where indexed menuItem is selected.

  if (selectedLevel == 0) {activeScene = [level2_1Scene node]; [[CCDCD shared director] PushScen: ActiveSecine]; } And if (selected level == 1) {activeScene = [level2_2Scene node]; [[Ccdceter Shared Director] PushScen: Active Sense]; } And if (selected level == 2) {activeScene = [level2_3Scene node]; [[Ccdceter Shared Director] PushScen: Active Sense];   

... for all levels at this level

How can I do this with a simpler form like it is something that is not working activation = [[NSString stringWithFormat: @ "level2_% d", selected level + 1] node]; [[Ccdceter Shared Director] PushScen: Active Sense]; This snippet from my factory may probably do your trick after optimization:

Skills * skkk = (Skills *) NSClassFromString (className); If (skkk) {return (skill *) [[skkk class] skillWithSpec: ss]; } Other {MPLogger (@ "**************************************************************************************************** **************************************************************************************************** ****** *************************************); MPLOGERROR (@ "no class with name% @", classname); MPLOGERROR (@ "***************************************************************************************************** ***********************); Return zero; }

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -