本文整理汇总了C++中Puzzle::setParticleSpawn方法的典型用法代码示例。如果您正苦于以下问题:C++ Puzzle::setParticleSpawn方法的具体用法?C++ Puzzle::setParticleSpawn怎么用?C++ Puzzle::setParticleSpawn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Puzzle
的用法示例。
在下文中一共展示了Puzzle::setParticleSpawn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadPuzzles
//Puzzle functions
void World::loadPuzzles(string file) {
//Load puzzles
char buffer[64];
string dataText, argText;
ifstream lvl(file);
int phase = 0;
//Helper variables for loading puzzles
PartData data;
string type, dynamic;
vector <PartData> parts;
Puzzle *puzzle = NULL;
int bonus, challenge, time, par, parX, parY;
//Load level
while (!lvl.eof()) {
//Read to buffer
lvl >> buffer;
argText = buffer;
dataText = buffer;
dataText.erase(std::remove(dataText.begin(), dataText.end(), ','), dataText.end());
if (dataText.find("door") != -1) {
//Done with description line, start phase 1
phase = 1;
}
else if (phase && dataText.find("puzzle") != -1) {
lvl >> buffer;
if (puzzle != NULL) {
puzzle->setParts(parts);
puzzle->setChallenge(challenge);
puzzle->setBonus(bonus);
puzzle->setTime(time);
puzzle->setParticleSpawn(par, parX, parY);
puzzles->push_back(puzzle);
}
puzzle = new Puzzle();
parts.clear();
bonus = 0;
challenge = 0;
time = -1;
par = 0;
parX = 0;
parY = 0;
}
else if (phase) {