示例#1
0
cocos2d::CCScene* InGameScene::scene()
{
	CCScene *scene = NULL;
	do
	{
		scene = CCScene::create();
        scene->setTag(TAG_INGAMESCENE);
		CC_BREAK_IF(!scene);

        pUILayer = CCLayer::create();
        CC_BREAK_IF(!pUILayer);
        pUILayer->setTag(TAG_INGAMEUILAYER);
        scene->addChild(pUILayer, 1000);
        
		InGameScene *layer = InGameScene::create();
//        layer->setTag(TAG_INGAMELAYER);
		CC_BREAK_IF(!layer);

        
        
		layer->setTag(INGAME);
		scene->addChild(layer);
        
        pScene = scene;
        
	} while(0);

	return scene;
}
示例#2
0
文件: GameScene.cpp 项目: kjiwu/Snake
CCScene* GameScene::scene()
{
	CCScene* s = CCScene::create();
	s->addChild(GameScene::create());
	s->setTag(GAMESCENE_TAG);
	return s;
}
示例#3
0
CCScene* StartLayer::scene(int tarIndex)
{
    CCScene* scene = CCScene::create();
    scene->setTag(SceneTypeStart);
    auto layer = StartLayer::create(tarIndex);
    
    scene->addChild(layer);
    
    return scene;
}
示例#4
0
CCScene* MainScene::scene()
{
	CCScene* scene = MainScene::create();
	scene->setTag(Main_SCENE_TAG);

	MainLayer* layer = MainLayer::create();
	scene->addChild(layer, 0);

	return scene;
}
示例#5
0
CCScene* GameLayer::scene()
{
    CCScene* scene = CCScene::create();
    scene->setTag(SceneTypeGame);
    auto layer = GameLayer::create();
    
    scene->addChild(layer);
    
    return scene;
}
示例#6
0
CCScene* Game::scene()
{
    CCScene *sc = CCScene::create();
    sc->setTag(TAG_GAME_SCENE);
    Game *g = Game::create();
    sc->addChild(g, 0, TAG_GAME_LAYER);
    HUD *h = HUD::create();
    sc->addChild(h,1,TAG_HUD);
    Pause *p = Pause::create();
    sc->addChild(p,1,TAG_PAUSE);
    GameOver *go = GameOver::create();
    sc->addChild(go,1,TAG_GAMEOVER);
    return sc;
}
示例#7
0
CCScene* LevelLayer::scene(int mode)
{
  // 'scene' is an autorelease object
  CCScene *scene = CCScene::create();

  // 'layer' is an autorelease object
  LevelLayer *layer = LevelLayer::create(mode);
    layer->setTag(LAYER_LEVEL);
  // add layer as a child to scene
  scene->addChild(layer);
    scene->setTag(SCENE_LEVEL);

  // return the scene
  return scene;
}
示例#8
0
cocos2d::CCScene* LoadingScene::scene()
{
    CCScene *scene = NULL;
	do
	{
		scene = CCScene::create();
        scene->setTag(TAG_LOADINGSCENE);
		CC_BREAK_IF(!scene);
        
		LoadingScene *layer = LoadingScene::create();
		CC_BREAK_IF(!layer);
        
		layer->setTag(LOADING);
		scene->addChild(layer);
	} while(0);
    
	return scene;
}