本文整理汇总了C++中Level::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Level::begin方法的具体用法?C++ Level::begin怎么用?C++ Level::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Level
的用法示例。
在下文中一共展示了Level::begin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: smallestRouteFile
int smallestRouteFile(const string &f) {
int i, r;
Grid v;
Level l;
//Init
v = readFile(f);
//Copy left side numbers
for(i = 0; i < v.size(); i++)
l.push_back(v[i][0]);
//Calc smallest to right
for(i = 1; i < v.size(); i++)
l = NextLevel(v, l, i);
//get smallest at first position
sort(l.begin(), l.end());
return l[0];
}
示例2: addLevel
SymbolTable::iterator SymbolTable::addLevel(Level lev, SymbolTable::iterator before){
auto chk = lookup.find(lev.name);
if(chk != lookup.end()){
iterator iter = chk->second;
iter->merge(lev.begin(), lev.end());
return iter;
}else if(before!=levelList.end()){
double ind1 = before->getIndex();
double ind2 = ind1-10;
if(ind2 < 0) throw TableException();
else if(!before->prev.empty()) ind2 = getLevel(before->prev)->getIndex();
lev.setIndex((ind1+ind2)/2);
lev.prev = before->prev;
before->prev = lev.name;
}else{
lev.setIndex(mx_ind);
mx_ind+=1e6;
lev.prev = (--levelList.end())->name;
}
levelList.push_back(lev);
return lookup[lev.name] = --levelList.end();
}
示例3: run
void Game::run(){
sf::Clock clock;
c::initialize();
logger::timing("Constants initialized in " + to_string(clock.getElapsedTime().asSeconds()) + " seconds.");
clock.restart();
gi::initalize(window);
gi::smoothCamera = true;
logger::timing("Graphics interface initialized in " + to_string(clock.getElapsedTime().asSeconds()) + " seconds.");
gi::renderWindow->setMouseCursorVisible(false);
Level* level = NULL;
Time lastTime;
while(gi::startOfFrame()){
if(!managerInitialized){
gi::darken(1.0f);
gi::endOfFrame();
clock.restart();
manager = new Manager();
manager->initialize(window);
logger::timing("Manager initialized in " + to_string(clock.getElapsedTime().asSeconds()) + " seconds.");
controller = new Controller();
controller->initialize(manager);
managerInitialized = true;
continue;
}
if(level == NULL){
gi::darken(1.0f);
gi::endOfFrame();
clock.restart();
level = new Level(manager, controller);
level->begin();
logger::timing("Level initialized in " + to_string(clock.getElapsedTime().asSeconds()) + " seconds.");
clock.restart();
}
if(manager->inputManager->isPressed(Keyboard::Escape)){
window->close();
}
Time time = clock.getElapsedTime();
float dt = (time - lastTime).asSeconds();
gi::collisionBoxes = manager->inputManager->isPressed(Keyboard::C);
manager->tick(window, time, dt);
window->clear();
level->tick();
manager->menuManager->draw(time);
lastTime = time;
gi::endOfFrame();
}
delete level;
manager->finalize(window);
delete manager;
gi::finalize();
delete controller;
}