本文整理汇总了C++中Hud::getGameOverText方法的典型用法代码示例。如果您正苦于以下问题:C++ Hud::getGameOverText方法的具体用法?C++ Hud::getGameOverText怎么用?C++ Hud::getGameOverText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hud
的用法示例。
在下文中一共展示了Hud::getGameOverText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IndieLib
//.........这里部分代码省略.........
vector<Planet*> mPlanets;
Ship* mShip = NULL;
bool loadSave = false;
float mDelta = 0.0f;
IND_Timer* mTimer = new IND_Timer;
mTimer->start();
while (!mI->_input->onKeyPress(IND_ESCAPE) && !mI->_input->quit() && !mMenu->isExit())
{
// get delta time
mDelta = mI->_render->getFrameTime() / 1000.0f;
if (mI->_input->isKeyPressed(controls->getMenu()))
{
mMenu->show();
SoundEngine::getSoundEngine()->setAllSoundsPaused(true);
}
if (!mMenu->isHidden())
{
mMenu->updateMenu(mHud, quickSave, mPlanets, mShip);
loadSave = mHud->getLoadingText()->isShow();
}
else
{
if (loadSave)
{
mDelta = 0.0;
loadSave = false;
SoundEngine::getSoundEngine()->setAllSoundsPaused(true);
mHud->getLoadingText()->setShow(false);
quickSave->loadSave(mI, mShip, mPlanets);
mHud->showHud();
}
if (mShip != NULL)
{
if (mI->_input->onKeyPress(controls->getQuickSave()))
{
quickSave->makeSave(mI, mShip, mPlanets);
}
mHud->updateHud(mShip);
if (mI->_input->onKeyPress(controls->getQuickLoad()))
{
deleteObjects(mHud, mShip, mPlanets);
loadSave = true;
}
if (mShip->isDestroyed())
{
SoundEngine::getSoundEngine()->setAllSoundsPaused(true);
mHud->updateGameOverText(mShip->getScore());
deleteObjects(mHud, mShip, mPlanets);
mHud->getLoadingText()->setShow(false);
mHud->getGameOverText()->setShow(true);
mMenu->show();
}
if(mShip!=NULL)
{
//----- Collisions -----
checkShipPlanetsCollisions(mI, mPlanets, mShip);
checkBulletsPlanetsCollisions(mI, mPlanets, mShip);
checkBulletsShipCollisions(mI, mPlanets, mShip);
//----- Movement update -----
mShip->updateShip(controls, mDelta);
if ((mTimer->getTicks() / 1000.0f) >= 3.0f)
{
mTimer->start();
mPlanets.at(rand() % mPlanets.size())->addSatellite();
}
for (vector<Planet*>::iterator it = mPlanets.begin(); it != mPlanets.end(); ++it)
{
(*it)->updatePlanet(mDelta, (mShip->getPosX() + 0.25f * mShip->getHeight() * cos(mShip->getAngleZRadian())), (mShip->getPosY() - 0.25f * mShip->getHeight() * sin(mShip->getAngleZRadian())));
}
}
}
}
//mI->_render->showFpsInWindowTitle();
mI->_input->update();
mI->_render->beginScene();
mI->_entity2dManager->renderEntities2d();
mI->_render->endScene();
}
// ----- Free -----
delete controls;
delete error;
delete mHud;
delete mMenu;
delete quickSave;
mI->_surfaceManager->remove(mSurfaceBack);
mI->_entity2dManager->remove(mBack);
deleteObjects(mHud, mShip, mPlanets);
mI->end();
return 0;
}