本文整理汇总了C++中Enemy::boundingBox方法的典型用法代码示例。如果您正苦于以下问题:C++ Enemy::boundingBox方法的具体用法?C++ Enemy::boundingBox怎么用?C++ Enemy::boundingBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Enemy
的用法示例。
在下文中一共展示了Enemy::boundingBox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addSmallEnemy
void LayerEnemy::addSmallEnemy(float dt)
{
Enemy *smallPlane = Enemy::create();
smallPlane->bindEnemySprite(CCSprite::createWithSpriteFrameName("enemy1.png"), SMALL_MAXLIFE);
m_psmallArray->addObject(smallPlane);
addChild(smallPlane);
//! 随机产生0.0~1.0的数
float x = CCRANDOM_0_1()*(winSize.width - smallPlane->getBoundingBox().size.width) + smallPlane->getBoundingBox().size.width /2;
float y = winSize.height + smallPlane->boundingBox().size.height / 2;
CCPoint smallBirth = ccp(x, y);
smallPlane->setPosition(smallBirth);
CCMoveTo *to = CCMoveTo::create(3, ccp(
smallBirth.x,
smallBirth.y - winSize.height - smallPlane->getBoundingBox().size.height /2
));
CCCallFuncN *actionDone = CCCallFuncN::create(this, callfuncN_selector(LayerEnemy::smallEnemyMoveFinishedFCallBack));
CCSequence *sequence = CCSequence::create(to, actionDone, NULL);
smallPlane->runAction(sequence);
//CCLog("%p", smallPlane);
//CCLog("before count = %d", m_psmallArray->count());
}