Sound when crashing into obstacle added

This commit is contained in:
Tleety
2015-06-01 23:28:31 +02:00
parent 8bd3ccf4cf
commit c15a082e4f
7 changed files with 14 additions and 6 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -69,7 +69,6 @@ void Systems::CollisionSystem::Intersects(EntityID aEntity, EntityID bEntity)
if(bCollisionComponent == nullptr)
return;
auto aBounds = m_World->GetComponent<Components::Bounds>(aEntity, "Bounds");
auto bBounds = m_World->GetComponent<Components::Bounds>(bEntity, "Bounds");
@@ -83,7 +83,6 @@ void Systems::LevelGenerationSystem::SpawnObstacle()
void Systems::LevelGenerationSystem::Update( double dt )
{
elapsedtime += dt;
spawnFrequency = 10/velocity;
@@ -91,9 +90,6 @@ void Systems::LevelGenerationSystem::Update( double dt )
SpawnObstacle();
elapsedtime = 0;
}
}
void Systems::LevelGenerationSystem::UpdateEntity( double dt, EntityID entity, EntityID parent )
+14
View File
@@ -13,6 +13,7 @@ Systems::PlayerSystem::PlayerSystem( World* world ) : System(world)
m_poweruptimeleft = 0;
m_basespeed = 125.f;
m_maxspeed = 125.f;
}
void Systems::PlayerSystem::Update(double dt)
@@ -196,7 +197,20 @@ void Systems::PlayerSystem::UpdateEntity(double dt, EntityID entity, EntityID pa
{
if(m_World->GetProperty<std::string>(ent, "Name") == "Obstacle")
{
auto deathSoundEntity = m_World->CreateEntity(ent);
auto deathTransform = m_World->AddComponent<Components::Transform>(deathSoundEntity, "Transform");
auto deathSoundEmitter = m_World->AddComponent<Components::SoundEmitter>(deathSoundEntity, "SoundEmitter");
deathSoundEmitter->Gain = 5.f;
deathSoundEmitter->ReferenceDistance = 1.5f;
auto deathSoundSystem = m_World->GetSystem<Systems::SoundSystem>("SoundSystem");
deathSoundSystem->PlaySound(deathSoundEmitter.get(), "Sounds/Explosion3.wav");
m_World->RemoveEntity(entity);
//TODO: Ljud som kommer från crashsite
}
}
-1
View File
@@ -32,7 +32,6 @@ namespace Systems
private:
float m_PlayerSpeed;
glm::vec3 m_PlayerOriginalBounds;
glm::vec3 m_CameraOffset;
glm::quat m_CameraOrientation;