当前位置: 首页>>代码示例>>C++>>正文


C++ BallSprite::getDisplayMode方法代码示例

本文整理汇总了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())
                {
                    {
//.........这里部分代码省略.........
开发者ID:jindaw,项目名称:learn,代码行数:101,代码来源:BallMap.cpp


注:本文中的BallSprite::getDisplayMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。