Пример #1
0
void GameState::DestroyActor(const std::set<boost::shared_ptr<LagomActor>>::iterator& actor)
{
	double score = (*actor)->GetScore();

	Ogre::ColourValue color;

	if( (*actor)->IsPositive())
		color = Lagom::getSingleton().GetPlayerColor();
	else
		color = Ogre::ColourValue(0.0f,0.0f,0.0f,1.0f);

	if( actor->get() == _playerBase)
	{
		_playerBase = nullptr;
		_gameOverTime = _gameTime + GameOverDelay;
	}
	
	if(score != 0.0f && _playerBase)
		AwardScore( score );

	Ogre::Vector3 location = (*actor)->GetLocation();

	_particleManager->AddParticleBunch( color, location , Ogre::Vector3(0.0f,50.0f,0.0f), ExplosionParticleLife, (*actor)->GetFactory()->DeathParticleSize , 10.0f);

	Lagom::getSingleton().PlaySound( (*actor)->GetFactory()->DeathSound , 1.0f, location);

	UnregisterActor(*actor);
}