Creating the Options scene

Similar to how we created the MainMenuScene, we will create OptionsMenuScene.h and OptionsMenuScene.cpp and include them in the Solution Explorer pane.

In the OptionsMenuScene.h file, add the following code:

#ifndef __wp8Game__OPTIONSMENU_SCENE__
#define __wp8Game__OPTIONSMENU_SCENE__

#include "cocos2d.h"
#include "ScrollingBgLayer.h"

using namespace cocos2d;

class OptionsMenu : public cocos2d::CCLayer
    virtual bool init();  

    ScrollingBgLayer* scrollingBgLayer;

    static cocos2d::CCScene* scene();
    void update(float dt);

    void reset(CCObject* pSender);
    void mainMenu(CCObject* pSender);



Here once again, we include ScrollingBgLayer.h, inherit from CCLayer, and add in the usual code, as ...

Get Learning Cocos2d-x Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.