本文整理汇总了C++中Explosion::Render方法的典型用法代码示例。如果您正苦于以下问题:C++ Explosion::Render方法的具体用法?C++ Explosion::Render怎么用?C++ Explosion::Render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Explosion
的用法示例。
在下文中一共展示了Explosion::Render方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
/**
* Render Cycle
*
* Clear the screen and render all the ships
*/
void Application::Render()
{
hge_->Gfx_BeginScene();
hge_->Gfx_Clear(0);
// Background
if (background)
{
background->Render(0, 0);
}
// Base
if (base)
{
base->Render(S_SCREEN_WIDTH * 0.5f, S_SCREEN_HEIGHT * 0.5f);
}
ShipList::iterator itr;
for (itr = ships_.begin(); itr != ships_.end(); itr++)
{
(*itr)->Render();
}
// Lab 13 Task 6 : Render the missile
if (mymissile)
{
mymissile->Render();
}
// Lab 13 Task 12 : Render network missiles
MissileList::iterator itr2;
for (itr2 = missiles_.begin(); itr2 != missiles_.end(); itr2++)
{
(*itr2)->Render();
}
// Render enemies
for (vector<Enemy*>::iterator it = enemyList.begin(); it != enemyList.end(); ++it)
{
Enemy* e = *it;
if (e->GetActive())
{
e->Render();
}
}
// Render projectile
for (vector<Projectile*>::iterator it = projectileList.begin(); it != projectileList.end(); ++it)
{
Projectile* p = *it;
if (p->GetActive())
{
p->Render();
}
}
// Render boom
for (vector<Boom*>::iterator it = boomList.begin(); it != boomList.end(); ++it)
{
Boom* b = *it;
if (b->isActive())
{
b->Render();
}
}
// Render explosion
for (vector<Explosion*>::iterator it = explosionList.begin(); it != explosionList.end(); ++it)
{
Explosion* e = *it;
if (e->isActive())
{
e->Render();
}
}
// Base hp
if (f_base_hp)
{
f_base_hp->Render(S_SCREEN_WIDTH * 0.5f, S_SCREEN_HEIGHT * 0.1f, HGETEXT_CENTER, std::to_string(base_hp).c_str());
}
// Score
if (p1_score)
{
string score = "Your score: " + std::to_string(ships_.at(0)->GetScore());
p1_score->Render(S_SCREEN_WIDTH * 0.25f, S_SCREEN_HEIGHT * 0.1f, HGETEXT_CENTER, score.c_str());
}
if (p2_score && ships_.size() > 1)
{
string score = "Other score: " + std::to_string(ships_.at(1)->GetScore());
p1_score->Render(S_SCREEN_WIDTH * 0.75f, S_SCREEN_HEIGHT * 0.1f, HGETEXT_CENTER, score.c_str());
}
// Chat
//.........这里部分代码省略.........