本文整理汇总了C++中Boss::setElapsedTime方法的典型用法代码示例。如果您正苦于以下问题:C++ Boss::setElapsedTime方法的具体用法?C++ Boss::setElapsedTime怎么用?C++ Boss::setElapsedTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Boss
的用法示例。
在下文中一共展示了Boss::setElapsedTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetGame
void Game::ResetGame()
{
std::vector<std::string> enemies;
enemies.push_back("Enemy1");
enemies.push_back("Enemy2");
enemies.push_back("Enemy3");
for(unsigned int i = 0; i < enemies.size(); i++)
{
AIShip* enemy = dynamic_cast<AIShip*>(Game::GetGameObjectManager().Get(enemies[i]));
assert(NULL != enemy);
enemy->setElapsedTime(0);
}
WeaponPowerUp* weapon = dynamic_cast<WeaponPowerUp*>(Game::GetGameObjectManager().Get("WeaponPowerUp"));
assert(NULL != weapon);
weapon->setPowerUpLevel(1);
weapon->setElapsedTime(20.f);
weapon->SetPosition(SCREEN_WIDTH/2, _gameField.Top - 100);
ShieldPowerUp* shield = dynamic_cast<ShieldPowerUp*>(Game::GetGameObjectManager().Get("ShieldPowerUp"));
assert(NULL != weapon);
shield->setElapsedTime(10.f);
shield->SetPosition(SCREEN_WIDTH/2, _gameField.Top - 100);
_score = 0;
Boss* boss = dynamic_cast<Boss*>(Game::GetGameObjectManager().Get("Boss"));
assert(NULL != boss);
boss->setElapsedTime(0.f);
AILaser* laser1 = dynamic_cast<AILaser*>(Game::GetGameObjectManager().Get("AILaser1"));
assert(NULL != laser1);
laser1->setElapsedTime(0.f);
laser1->setSpeed(0.f);
laser1->SetPosition(SCREEN_WIDTH/2, _gameField.Top - 100);
AILaser2* laser2 = dynamic_cast<AILaser2*>(Game::GetGameObjectManager().Get("AILaser2"));
assert(NULL != laser2);
laser2->setElapsedTime(0.f);
laser2->setSpeed(0.f);
laser2->SetPosition(SCREEN_WIDTH/2, _gameField.Top - 100);
AILaser3* laser3 = dynamic_cast<AILaser3*>(Game::GetGameObjectManager().Get("AILaser3"));
assert(NULL != laser3);
laser3->setElapsedTime(0.f);
laser3->setSpeed(0.f);
laser3->SetPosition(SCREEN_WIDTH/2, _gameField.Top - 100);
BossLaser* blaser = dynamic_cast<BossLaser*>(Game::GetGameObjectManager().Get("BossLaser"));
assert(NULL != blaser);
blaser->setElapsedTime(0.f);
blaser->setSpeed(0.f,0.f);
blaser->SetPosition(SCREEN_WIDTH/2, _gameField.Top - 100);
}