64,282
社区成员
发帖
与我相关
我的任务
分享
bool Hero::heroInit()
{
heroSprite=CCSprite::create("p1tankU.png");
heroSprite->setAnchorPoint(CCPointZero);
this->addChild(heroSprite);
isHeroMoving=false;
return true;
}
bool GameLayer::init()
{
bool bRet = false;
do
{
sGlobal->gameMap=GameMap::gameMapWithTMXFile("0.tmx");
addChild(sGlobal->gameMap,kZMap,kZMap);
sGlobal->hero=Hero::heroWithinLayer();
sGlobal->hero->setPosition(sGlobal->gameMap->positionForTileCoord(ccp(4,9)));
addChild(sGlobal->hero,kZHero,kZHero);
bRet = true;
} while (0);
return bRet;
}
bool Hero::heroInit()
{
if(true)
{
heroSprite=CCSprite::create("p1tankU.png");
heroSprite->setAnchorPoint(CCPointZero);
this->addChild(heroSprite);
isHeroMoving=false;
return true;
}
else
{
return flase;
}
}