• 大小: 19.41MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2023-06-30
  • 语言: 其他
  • 标签: cocos2d-x  

资源简介

关于cocos2d-x的小游戏 分享一下

资源截图

代码片段和文件信息

#include “AboutScene.h“

#include “HelloWorldScene.h“

using namespace cocos2d;


cocos2d::CCScene* AboutScene::scene()
{
CCScene * scene = NULL;
do 
{
// ‘scene‘ is an autorelease object
scene = CCScene::create();
CC_BREAK_IF(! scene);

// ‘layer‘ is an autorelease object
AboutScene* layer = AboutScene::create();
CC_BREAK_IF(! layer);

// add layer as a child to scene
scene->addChild(layer);
} while (0);

// return the scene
return scene;
}

bool AboutScene::init()
{
bool bRet = false;
do 
{
std::string titleStr = “Go!Fish!Go!\n For Cocos2d-x\n All the resources come \nfrom the network\n\n Author:northroom\n Email:northroom1@gmail.com “;

CCLabelTTF* pLable = CCLabelTTF::create(titleStr.c_str() “Thonburi“ 30);

CC_BREAK_IF(!pLable);
pLable->setColor(ccBLUE);

CCSize winSize = CCDirector::sharedDirector()->getWinSize();

//pLable->setAnchorPoint(ccp(01));

pLable->setPosition(ccp(winSize.width/2winSize.height/2));

this->addChild(pLable1);


std::string str;

str=“Back“;

CCMenuItemFont* backMenu = CCMenuItemFont::create(str.c_str()thismenu_selector(AboutScene::backCallback));

CCMenu* mn = CCMenu::create(backMenuNULL);
mn->setPosition(ccp(00));

backMenu->setAnchorPoint(ccp(10));
backMenu->setPosition(ccp(winSize.width0));

this->addChild(mn1);


bRet = true;

} while (0);
return(bRet);
}


void AboutScene::backCallback(cocos2d::CCobject* pSender)
{
CCScene * scene=HelloWorld::scene();
CCDirector::sharedDirector()->replaceScene(CCTransitionFlipX::create(1.2fscene));
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-08-13 16:04  EatFish\
     文件        6148  2013-08-13 16:04  EatFish\.DS_Store
     目录           0  2013-08-13 16:05  __MACOSX\
     目录           0  2013-08-13 16:05  __MACOSX\EatFish\
     文件         176  2013-08-13 16:04  __MACOSX\EatFish\._.DS_Store
     目录           0  2013-08-13 16:05  EatFish\.git\
     目录           0  2013-08-13 13:51  EatFish\.git\branches\
     文件         138  2013-08-13 13:51  EatFish\.git\config
     文件          73  2013-08-13 13:51  EatFish\.git\description
     文件          23  2013-08-13 13:51  EatFish\.git\HEAD
     目录           0  2013-08-13 13:51  EatFish\.git\hooks\
     文件         452  2013-08-13 13:51  EatFish\.git\hooks\applypatch-msg.sample
     文件         896  2013-08-13 13:51  EatFish\.git\hooks\commit-msg.sample
     文件         189  2013-08-13 13:51  EatFish\.git\hooks\post-update.sample
     文件         398  2013-08-13 13:51  EatFish\.git\hooks\pre-applypatch.sample
     文件        1704  2013-08-13 13:51  EatFish\.git\hooks\pre-commit.sample
     文件        4951  2013-08-13 13:51  EatFish\.git\hooks\pre-rebase.sample
     文件        1239  2013-08-13 13:51  EatFish\.git\hooks\prepare-commit-msg.sample
     文件        3611  2013-08-13 13:51  EatFish\.git\hooks\update.sample
     文件       70304  2013-08-13 14:56  EatFish\.git\index
     目录           0  2013-08-13 13:51  EatFish\.git\info\
     文件          35  2013-08-13 13:51  EatFish\.git\info\exclude
     目录           0  2013-08-13 16:05  __MACOSX\EatFish\.git\
     目录           0  2013-08-13 16:05  __MACOSX\EatFish\.git\info\
     文件         171  2013-08-13 13:51  __MACOSX\EatFish\.git\info\._exclude
     目录           0  2013-08-13 14:55  EatFish\.git\objects\
     目录           0  2013-08-13 14:56  EatFish\.git\objects\00\
     文件        1473  2013-08-13 13:51  EatFish\.git\objects\00\8b8026f772525ccff6c3361ecc6f3eb43d0d82
     文件       14646  2013-08-13 14:56  EatFish\.git\objects\00\a54c6a259bc916cc4f26ac27957d901ca9576a
     目录           0  2013-08-13 13:51  EatFish\.git\objects\01\
     文件        8317  2013-08-13 13:51  EatFish\.git\objects\01\6a37970ecab4cf29a837439d581c0fb1bf7218
............此处省略2194个文件信息

评论

共有 条评论