You should follow this official tutorial to learn how to create good endless title map: http://www.cocos2d-x.org/docs/tutorial/parkour-game-with-javascript/chapter7/en
Even this is a tutorial for javascript but the class used is the same. Hope it help.