Hello Guys, I am making one game where I have to implement main menu and then other parts of game. On launch my game will show main-menu on clicking of play-button game will start and so on for different buttons. So here I have to make transitions..let us say between two screen first is main menu and other is game screen. I took two classes mainMenu.cpp and GameScreen.cpp and inherited them from CCLayer and in static scene() method,I am returning the scene of respective class.

Whenever you are writing any layer for your game,call all the actions for that layer in init(). Also while creating new file,make sure you have selected proper template for your class. When I followed these steps properly,problem was solved for me. Code above I wrote is correct and working fine.