本文整理汇总了C++中CCMoveBy::copy方法的典型用法代码示例。如果您正苦于以下问题:C++ CCMoveBy::copy方法的具体用法?C++ CCMoveBy::copy怎么用?C++ CCMoveBy::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCMoveBy
的用法示例。
在下文中一共展示了CCMoveBy::copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pipeCreate
void GameScene::pipeCreate(float dt)
{
randomValue = 18 + CCRANDOM_0_1() * 50;
CCSprite* pipeUp = CCSprite::createWithSpriteFrameName("pipe_up.png");
pipeUp->setAnchorPoint(ccp(0.5f, 0));
pipeUp->setPosition(ccp(screenSize.width * 1.2f, -randomValue * pipeUp->getContentSize().height / 100));
addChild(pipeUp, 2);
CCSprite* pipeDown = CCSprite::createWithSpriteFrameName("pipe_down.png");
pipeDown->setAnchorPoint(ccp(0.5f, 0));
pipeDown->setPosition(ccp(pipeUp->getPositionX(), pipeUp->getPositionY() + pipeUp->getContentSize().height + screenSize.height * 0.19f));
addChild(pipeDown, 2);
CCMoveBy* move = CCMoveBy::create(4.0f, ccp(-1000, 0));
CCCallFuncN* call = CCCallFuncN::create(this, callfuncN_selector(GameScene::pipeUpRemove));
CCSequence* seq = CCSequence::create(move, call, NULL);
pipeUp->runAction(seq);
pipeUp->setUserData((void*)0);
pipeArray->addObject(pipeUp);
CCCallFuncN* downCall = CCCallFuncN::create(this, callfuncN_selector(GameScene::pipeDownRemove));
CCSequence* downSeq = CCSequence::create((CCActionInterval*)(move->copy()->autorelease()), downCall, NULL);
pipeDown->runAction(downSeq);
hitCheckArray->addObject(pipeUp);
hitCheckArray->addObject(pipeDown);
}