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


C++ TileMap::copyCellAt方法代码示例

本文整理汇总了C++中TileMap::copyCellAt方法的典型用法代码示例。如果您正苦于以下问题:C++ TileMap::copyCellAt方法的具体用法?C++ TileMap::copyCellAt怎么用?C++ TileMap::copyCellAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TileMap的用法示例。


在下文中一共展示了TileMap::copyCellAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AnimatedCollideableSprite

CharacterClone::CharacterClone(int width, int height, std::vector<State> stateStack, b2Body* body, QGraphicsItem *parent) :
    AnimatedCollideableSprite(width, height, body, parent)
{
    this->setZValue(1);
    this->setSolid(true);

    TileMap * playerTiles = new TileMap(32, 32, 0, 0, "./resources/sprites/mainCharClone.png");


    std::vector<QPixmap> standRight;
    standRight.push_back(playerTiles->copyCellAt(0, 0));

    std::vector<QPixmap> standLeft;
    standLeft.push_back(playerTiles->copyCellAt(4, 0));

    std::vector<QPixmap> walkRight;
    walkRight.push_back(playerTiles->copyCellAt(0, 0));
    walkRight.push_back(playerTiles->copyCellAt(1, 0));
    walkRight.push_back(playerTiles->copyCellAt(2, 0));
    walkRight.push_back(playerTiles->copyCellAt(3, 0));

    std::vector<QPixmap> walkLeft;
    walkLeft.push_back(playerTiles->copyCellAt(7, 0));
    walkLeft.push_back(playerTiles->copyCellAt(6, 0));
    walkLeft.push_back(playerTiles->copyCellAt(5, 0));
    walkLeft.push_back(playerTiles->copyCellAt(4, 0));

    std::vector<QPixmap> runRight;
    runRight.push_back(playerTiles->copyCellAt(0, 1));
    runRight.push_back(playerTiles->copyCellAt(1, 1));
    runRight.push_back(playerTiles->copyCellAt(2, 1));

    std::vector<QPixmap> runLeft;
    runLeft.push_back(playerTiles->copyCellAt(5, 1));
    runLeft.push_back(playerTiles->copyCellAt(4, 1));
    runLeft.push_back(playerTiles->copyCellAt(3, 1));

    std::vector<QPixmap> jumpRight;
    jumpRight.push_back(playerTiles->copyCellAt(0, 2));
    jumpRight.push_back(playerTiles->copyCellAt(1, 2));
    jumpRight.push_back(playerTiles->copyCellAt(2, 2));

    std::vector<QPixmap> jumpLeft;
    jumpLeft.push_back(playerTiles->copyCellAt(5, 2));
    jumpLeft.push_back(playerTiles->copyCellAt(4, 2));
    jumpLeft.push_back(playerTiles->copyCellAt(3, 2));

    std::vector<QPixmap> climb;
    climb.push_back(playerTiles->copyCellAt(0, 3));
    climb.push_back(playerTiles->copyCellAt(1, 3));

    this->addAnimation(standRight, Loop);
    this->addAnimation(standLeft, Loop);

    this->addAnimation(walkRight, Loop);
    this->addAnimation(walkLeft, Loop);

    this->addAnimation(runRight, Loop);
    this->addAnimation(runLeft, Loop);

    this->addAnimation(jumpRight, Forward);
    this->addAnimation(jumpLeft, Forward);

    this->addAnimation(climb, Loop);

    this->triggerAnimation(Stand_Right);

    m_stateStack = stateStack;
}
开发者ID:gMitchell09,项目名称:Point_Of_Divergence,代码行数:69,代码来源:characterclone.cpp


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