cocos2d-xで使うGameScene初期テンプレート
v.2
GameScene.h
#ifndef __GAME_SCENE_H__
#define __GAME_SCENE_H__
#include “cocos2d.h”
USING_NS_CC;
class GameScene : public CCLayer
{
public:
virtual bool init();
static CCScene* scene();
CREATE_FUNC(GameScene);
};
#endif // __GAME_SCENE_H__
GameScene.cpp
#include “GameScene.h”
using namespace cocos2d;
using namespace std;
CCScene* GameScene::scene()
{
CCScene* scene = CCScene::create();
GameScene* layer = GameScene::create();
scene->addChild(layer);
return scene;
}
bool GameScene::init()
{
if (!CCLayer::init())
return false;
return true;
}