本文整理汇总了C++中TileMap::createHall方法的典型用法代码示例。如果您正苦于以下问题:C++ TileMap::createHall方法的具体用法?C++ TileMap::createHall怎么用?C++ TileMap::createHall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TileMap
的用法示例。
在下文中一共展示了TileMap::createHall方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connectRooms
void Dungeon::connectRooms(TileMap *outputMap){
TileMap *dungeonMap = outputMap;
i = dungeonMap->numRooms;
TCODRandom *rng = new TCODRandom();
//x = rng->getInt(5, 30);
//y = rng->getInt(5, 30);
//w = 5
int prev_x, prev_y, new_x, new_y;
for ( x = 0; x < i; x++){
if (x != 0){
prev_x = dungeonMap->rooms[x-1]->cX;
prev_y = dungeonMap->rooms[x-1]->cY;
new_x = dungeonMap->rooms[x]->cX;
new_y = dungeonMap->rooms[x]->cY;
if ((rng->getInt(0, 1)) == 1){
dungeonMap->createHall(prev_x, new_x, prev_y, 0);
dungeonMap->createHall(prev_y, new_y, new_x, 1);
}
else {
dungeonMap->createHall(prev_y, new_y, prev_x, 1);
dungeonMap->createHall(prev_x, new_x, new_y, 0);
}
}
}
delete rng;
}