本文整理汇总了C++中TimeManager::clearAll方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeManager::clearAll方法的具体用法?C++ TimeManager::clearAll怎么用?C++ TimeManager::clearAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeManager
的用法示例。
在下文中一共展示了TimeManager::clearAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
random.initialize();
audioManager.playMusic();
init = true;
}
if((stageTwo == false) && (mainInterface.getScore() >= 280))
{
enemyManager.addEnemiesMedium();
stageTwo = true;
}
if((mainInterface.getScore() >= 560))
{
audioManager.stopMusic();
init = false;
menu = true;
}
time.updateShoot();
time.updateRandomShoot();
// REFRESHING WINDOW
// ALL PHYSICS HERE
while(time.getAccumulator() > time.getUps())
{
time.updateAccumulator();
player.keyboardControl(time.getUps(), bulletManager, time.getShootTimer(), time, audioManager);
enemyManager.controlEnemies(random, bulletManager, time);
bulletManager.controlBullets(time.getUps());
//COLLISIONS
bulletManager.checkPlayerCollisions(playerWsk);
enemyManager.updateDead(bulletManager);
player.gameOver(audioManager, menu, init);
}
//SIMPLE EVENTS
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
mainInterface.checkRecords(mainMenu);
//DRAWING
window.clear();
mainInterface.drawText(window, player.getHealth());
enemyManager.drawEnemies(window);
window.draw(player.getSprite());
bulletManager.drawBullets(window);
window.display();
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
{
window.close();
}
time.restartAccumulator();
}
else
{
if(menuMusic == false)
{
audioManager.playMenu();
menuMusic = true;
}
enemyManager.clearAll();
bulletManager.clearAll();
time.clearAll();
mainInterface.clearScore();
mainMenu.keyboardControl(window, menu);
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
mainMenu.drawMenu(window);
window.display();
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
{
window.close();
}
}
}
return EXIT_SUCCESS;
}