本文整理汇总了C++中BallSprite::getDisplayMode方法的典型用法代码示例。如果您正苦于以下问题:C++ BallSprite::getDisplayMode方法的具体用法?C++ BallSprite::getDisplayMode怎么用?C++ BallSprite::getDisplayMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BallSprite
的用法示例。
在下文中一共展示了BallSprite::getDisplayMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selfCheckHaveMore
TwoBallPos BallMap::selfCheckHaveMore()
{
TwoBallPos point_ab;
point_ab.srcPos = CCPointZero;
point_ab.destPos = CCPointZero;
// bool flag = false;
for (int row = 0; row != m_size.height; ++row)
{
for (int col = 0; col != m_size.width; ++col)
{
BallSprite* aSprite = BallOfRC(col, row);
if ( aSprite && (aSprite->getDisplayMode() == DISPLAY_MODE_FIVE || aSprite->getDisplayMode() == DISPLAY_MODE_SKILL))
{
point_ab.srcPos = ccp(aSprite->getCol(), aSprite->getRow());
}
//竖向是否有1 2情况的可移动消除 v 1 2
if (aSprite->getRow() - 1 >= 0)
{
BallSprite* bSprite = BallOfRC(col, row - 1);
if ( bSprite && aSprite->getImgIndex() == bSprite->getImgIndex())
{
/*
(x, y-2)
(x-1, y-1) (x, y-1) (x+1, y-1)
(x-1, y ) (x, y ) (x+1, y )
(x-1, y+1) (x, y+1) (x+1, y+1)
(x, y+2)
*/
{
BallSprite* cSprite = BallOfRC(col, row + 2);
if (cSprite && cSprite->getImgIndex() == aSprite->getImgIndex())
{
BallSprite* temp = BallOfRC(col, row+1);
point_ab.srcPos = ccp(cSprite->getCol(), cSprite->getRow());
point_ab.destPos = ccp(temp->getCol(), temp->getRow());
return point_ab;
}
}
{
BallSprite* cSprite = BallOfRC(col-1, row+1);
if (cSprite && cSprite->getImgIndex() == aSprite->getImgIndex())
{
BallSprite* temp = BallOfRC(col, row+1);
point_ab.srcPos = ccp(cSprite->getCol(), cSprite->getRow());
point_ab.destPos = ccp(temp->getCol(), temp->getRow());
return point_ab;
}
}
{
BallSprite* cSprite = BallOfRC(col+1, row+1);
if ( cSprite && cSprite->getImgIndex() == aSprite->getImgIndex())
{
BallSprite* temp = BallOfRC(col, row+1);
point_ab.srcPos = ccp(cSprite->getCol(), cSprite->getRow());
point_ab.destPos = ccp(temp->getCol(), temp->getRow());
return point_ab;
}
}
{
BallSprite* cSprite = BallOfRC(col, row-3);
if ( cSprite && cSprite->getImgIndex() == aSprite->getImgIndex())
{
BallSprite* temp = BallOfRC(col, row-2);
point_ab.srcPos = ccp(cSprite->getCol(), cSprite->getRow());
point_ab.destPos = ccp(temp->getCol(), temp->getRow());
return point_ab;
}
}
{
BallSprite* cSprite = BallOfRC(col-1, row-2);
if ( cSprite && cSprite->getImgIndex() == aSprite->getImgIndex())
{
BallSprite* temp = BallOfRC(col, row-2);
point_ab.srcPos = ccp(cSprite->getCol(), cSprite->getRow());
point_ab.destPos = ccp(temp->getCol(), temp->getRow());
return point_ab;
}
}
{
BallSprite* cSprite = BallOfRC(col+1, row-2);
if ( cSprite && cSprite->getImgIndex() == aSprite->getImgIndex())
{
BallSprite* temp = BallOfRC(col, row-2);
point_ab.srcPos = ccp(cSprite->getCol(), cSprite->getRow());
point_ab.destPos = ccp(temp->getCol(), temp->getRow());
return point_ab;
}
}
}
}
//v 1 3
if (aSprite->getRow()-2 >= 0)
{
BallSprite* bSprite = BallOfRC(col, row-2);
if ( bSprite && aSprite->getImgIndex() == bSprite->getImgIndex())
{
{
//.........这里部分代码省略.........