本文整理汇总了C++中CCArmature::getPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CCArmature::getPosition方法的具体用法?C++ CCArmature::getPosition怎么用?C++ CCArmature::getPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCArmature
的用法示例。
在下文中一共展示了CCArmature::getPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void GameScene::update(float dt)
{
CCArmature * imManArmature = playLayer->imManArmature;
int actionNum = playLayer->actionNum;
if(actionNum ==playLayer->ACTION_RUN)
{
playLayer->playerBoundingBox = CCRectMake(imManArmature->getPosition().x-imManArmature->getContentSize().width/2+46,imManArmature->getPosition().y,imManArmature->getContentSize().width-90,imManArmature->getContentSize().height-50);
}
else if(actionNum == playLayer->ACTION_STAND_JUMP)
{
playLayer->playerBoundingBox = CCRectMake(imManArmature->getPosition().x-imManArmature->getContentSize().width/2+30,imManArmature->getPosition().y,imManArmature->getContentSize().width-50,imManArmature->getContentSize().height-50);
}
else if(actionNum == playLayer->ACTION_RUN_JUMP)
{
playLayer->playerBoundingBox = CCRectMake(imManArmature->getPosition().x-imManArmature->getContentSize().width/2+33,imManArmature->getPosition().y,imManArmature->getContentSize().width-70,imManArmature->getContentSize().height-50);
}
else if(actionNum == playLayer->ACTION_RUN_STOP)
{
playLayer->playerBoundingBox = CCRectMake(imManArmature->getPosition().x-imManArmature->getContentSize().width/2+40,imManArmature->getPosition().y,imManArmature->getContentSize().width-110,imManArmature->getContentSize().height-45);
}
else if(actionNum == playLayer->ACTION_RUN_ATTACK)
{
playLayer->playerBoundingBox = CCRectMake(imManArmature->getPosition().x-imManArmature->getContentSize().width/2,imManArmature->getPosition().y,imManArmature->getContentSize().width,imManArmature->getContentSize().height);
}
else if(actionNum == playLayer->ACTION_STAND_ATTACK)
{
playLayer->playerBoundingBox = CCRectMake(imManArmature->getPosition().x-imManArmature->getContentSize().width/2,imManArmature->getPosition().y,imManArmature->getContentSize().width,imManArmature->getContentSize().height);
}
else if(actionNum == playLayer->ACTION_DEATH)
{
playLayer->playerBoundingBox = CCRectMake(imManArmature->getPosition().x-imManArmature->getContentSize().width/2,imManArmature->getPosition().y,imManArmature->getContentSize().width,imManArmature->getContentSize().height);
}
if(gameSceneMonster->MonsterIndex == MonsterGround_enum)
{
gameSceneMonster->MonsterAmatureBoundingBox = CCRectMake(gameSceneMonster->MonsterAmature->getPosition().x-gameSceneMonster->MonsterAmature->getContentSize().width/2+45,gameSceneMonster->MonsterAmature->getPosition().y+21,gameSceneMonster->MonsterAmature->getContentSize().width-90,gameSceneMonster->MonsterAmature->getContentSize().height-90);
}
else if(gameSceneMonster->MonsterIndex == MonsterSky_enum)
{
gameSceneMonster->MonsterAmatureBoundingBox = CCRectMake(gameSceneMonster->MonsterAmature->getPosition().x-gameSceneMonster->MonsterAmature->getContentSize().width/2+45,gameSceneMonster->MonsterAmature->getPosition().y+21,gameSceneMonster->MonsterAmature->getContentSize().width-90,gameSceneMonster->MonsterAmature->getContentSize().height-90);
}
if (playLayer->playerBoundingBox.intersectsRect(gameSceneMonster->MonsterAmatureBoundingBox))
{
/*
if(MonsterGround_enum == gameSceneMonster->MonsterIndex)
{
gameSceneMonster->unscheduleUpdate();
gameSceneMonster->MonsterDestroyAction();
}
*/
CCShake * shark = CCShake::create(0.3f,10);
playLayer->runAction(shark);
playLayer->imManArmatureBrood-=1;
if(playLayer->imManArmatureBrood<1)
{
GameScene::shareGameScene()->menuLayer->setBroodBarPercent(0);
this->unscheduleUpdate();
playLayer->IMDeath();
return;
}
GameScene::shareGameScene()->menuLayer->setBroodBarPercent(playLayer->imManArmatureBrood);
}
}