tank modifications

This commit is contained in:
Stiffly
2014-06-03 19:44:33 +02:00
parent e7eca74b03
commit a5105e5859
4 changed files with 22 additions and 1 deletions
+12
View File
@@ -108,6 +108,18 @@ void Systems::TankSteeringSystem::UpdateEntity(double dt, EntityID entity, Entit
m_TimeSinceLastShot[tankSteeringComponent->Barrel] += dt;
}
auto shot = m_World->GetComponent<Components::TankShell>(entity);
if(shot)
{
if(inputController->Shoot && m_TimeSinceLastShot[tankSteeringComponent->Barrel] > 0.5)
{
Events::PlaySFX e;
e.Resource = "Sounds/SFX/LongBoom.wav";
e.Emitter = entity;
EventBroker->Publish(e);
}
}
}
bool Systems::TankSteeringSystem::OnCollision( const Events::Collision &e )