本文整理汇总了C++中CBullet::IsDead方法的典型用法代码示例。如果您正苦于以下问题:C++ CBullet::IsDead方法的具体用法?C++ CBullet::IsDead怎么用?C++ CBullet::IsDead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBullet
的用法示例。
在下文中一共展示了CBullet::IsDead方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void CSceneMgr::Update( void )
{
CBullet* pBullet = NULL;
FireParameter* pFirePar = NULL;
CGraphicsEngine* pEngine = NULL;
pEngine = CGraphicsEngine::GetInstance();
if(pEngine->m_pDXInput->ReadKeyboard()){
if(pEngine->m_pDXInput->IsKeyPressed(DIK_UP)){
pEngine->ChangeCameraPosition(0,-1,0);
}
if(pEngine->m_pDXInput->IsKeyPressed(DIK_DOWN)){
pEngine->ChangeCameraPosition(0,1,0);
}
if(pEngine->m_pDXInput->IsKeyPressed(DIK_LEFT)){
pEngine->ChangeCameraPosition(0,0,-1);
}
if(pEngine->m_pDXInput->IsKeyPressed(DIK_RIGHT)){
pEngine->ChangeCameraPosition(0,0,1);
}
}
m_pTank->Updata();
CMessageMgr::Message msgGet;
while(CMessageMgr::GetInstance()->GetMessage(CMessageMgr::MSG_FIRE, &msgGet))
{
pFirePar = (FireParameter*)msgGet.dwParameterA;
pBullet = new CBullet(pFirePar->vPosition, pFirePar->vDirection, pFirePar->fAngle);
m_BulletList.push_back(pBullet);
delete pFirePar;
}
BulletList::iterator itDelete;
for (BulletList::iterator it = m_BulletList.begin(); it != m_BulletList.end();)
{
pBullet = *it;
pBullet->Update();
if (pBullet->IsDead())
{
itDelete = it;
++it;
delete pBullet;
m_BulletList.erase(itDelete);
}
else
++it;
}
}