#ifndef GAMELAYER_H
#define GAMELAYER_H
#include “cocos2d.h”
USING_NS_CC;
class GameLayr : public Layer
{
public:
GameLayr(void);
~GameLayr(void);
virtual bool init();
static Scene* scene();
CREATE_FUNC(GameLayr);
};
#endif // !1
CPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
#include “GameLayer.h”
GameLayr::GameLayr(void)
{
}
GameLayr::~GameLayr(void)
{
}
bool GameLayr::init()
{
if (!Layer::init())
{
return false;
}
return true;
}
Scene* GameLayr::scene()
{
auto scene = Scene::create();
auto layer = GameLayr::create();
scene->addChild(layer);
return scene;
}
在AppDelegate 里面这样怎么是错误的呢求高手指点一下啊
#include “AppDelegate.h”
//#include “HelloWorldScene.h”
#include “CCScene_Layer/GameLayer.h”
USING_NS_CC;
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
auto scene = GameLayr::create();
// run
director->runWithScene(scene);
提示的是cocos2d::Scene不兼容