1
Graphics / Re: Tank doesn't Shoot Multiple Bullets
« on: May 04, 2012, 09:50:35 pm »
You sir, are indeed a Hero Member.
Thanks
Thanks
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
void GameObjectManager::UpdateAll(float elapsedTime)
{
std::map<int, GameObject*>::const_iterator itr = gameObjects.begin();
while (itr != gameObjects.end())
{
itr->second->Update(elapsedTime);
itr++;
}
}
void Block::Update(float elapedTime)
{
sf::Time time = clock.getElapsedTime();
if (time.asSeconds() >= 5.0f)
{
Game::GetGameObjectManager().Remove(id);
}
}
void GameObjectManager::Remove(int id)
{
std::map<int, GameObject*>::iterator result = gameObjects.find(id);
if (result != gameObjects.end())
{
delete result->second;
gameObjects.erase(result);
}
}