本文整理汇总了C++中CBlock::SetSpriteSheet方法的典型用法代码示例。如果您正苦于以下问题:C++ CBlock::SetSpriteSheet方法的具体用法?C++ CBlock::SetSpriteSheet怎么用?C++ CBlock::SetSpriteSheet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlock
的用法示例。
在下文中一共展示了CBlock::SetSpriteSheet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetMap
void CApp::ResetMap(int mapIndex) {
// remove all blocks
for (auto itr = CBlock::BlockList.begin(); itr != CBlock::BlockList.end(); itr++) {
CBlock* pBlock = *itr;
if (pBlock) {
pBlock->OnMove(-MAP_W, -MAP_H); // this will reset the tile if it was on its home
delete pBlock;
}
}
CBlock::BlockList.clear();
CurrentMap = mapIndex;
if (CurrentMap > highestLevel)
highestLevel = CurrentMap;
CMap* pMap = maps[mapIndex];
ActionJackson.SetLoc(pMap->startX, pMap->startY);
ActionJackson.map = pMap;
ActionJackson.ClearUndoList();
// place all blocks
for (int i = 0; i < pMap->startBlocks.size(); i++) {
SDL_Point p = pMap->startBlocks[i];
CBlock* pBlock = new CBlock(p.x, p.y, pMap);
pBlock->SetSpriteSheet(block);
pBlock->OnMove(0, 0); // this will make the tile change to HOMEWITHBLOCK if applicable
CBlock::BlockList.push_back(pBlock);
}
// add some flavor
Uint8 redness = 2*(Uint8)CurrentMap;
SDL_SetTextureColorMod(Texture, 255, 255 - redness, 255 - redness);
}