diff --git a/Escape-the-Dawn/Sounds/Explosion1.wav b/Escape-the-Dawn/Sounds/Explosion1.wav new file mode 100644 index 0000000..8199657 Binary files /dev/null and b/Escape-the-Dawn/Sounds/Explosion1.wav differ diff --git a/Escape-the-Dawn/Sounds/Explosion2.wav b/Escape-the-Dawn/Sounds/Explosion2.wav new file mode 100644 index 0000000..1849bfa Binary files /dev/null and b/Escape-the-Dawn/Sounds/Explosion2.wav differ diff --git a/Escape-the-Dawn/Sounds/Explosion3.wav b/Escape-the-Dawn/Sounds/Explosion3.wav new file mode 100644 index 0000000..17473cd Binary files /dev/null and b/Escape-the-Dawn/Sounds/Explosion3.wav differ diff --git a/Escape-the-Dawn/Systems/CollisionSystem.cpp b/Escape-the-Dawn/Systems/CollisionSystem.cpp index 4bd04bf..00affe4 100644 --- a/Escape-the-Dawn/Systems/CollisionSystem.cpp +++ b/Escape-the-Dawn/Systems/CollisionSystem.cpp @@ -69,7 +69,6 @@ void Systems::CollisionSystem::Intersects(EntityID aEntity, EntityID bEntity) if(bCollisionComponent == nullptr) return; - auto aBounds = m_World->GetComponent(aEntity, "Bounds"); auto bBounds = m_World->GetComponent(bEntity, "Bounds"); diff --git a/Escape-the-Dawn/Systems/LevelGenerationSystem.cpp b/Escape-the-Dawn/Systems/LevelGenerationSystem.cpp index 1bd30ab..0e35196 100644 --- a/Escape-the-Dawn/Systems/LevelGenerationSystem.cpp +++ b/Escape-the-Dawn/Systems/LevelGenerationSystem.cpp @@ -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 ) diff --git a/Escape-the-Dawn/Systems/PlayerSystem.cpp b/Escape-the-Dawn/Systems/PlayerSystem.cpp index eba8ad9..0bb2381 100644 --- a/Escape-the-Dawn/Systems/PlayerSystem.cpp +++ b/Escape-the-Dawn/Systems/PlayerSystem.cpp @@ -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(ent, "Name") == "Obstacle") { + + auto deathSoundEntity = m_World->CreateEntity(ent); + + auto deathTransform = m_World->AddComponent(deathSoundEntity, "Transform"); + auto deathSoundEmitter = m_World->AddComponent(deathSoundEntity, "SoundEmitter"); + deathSoundEmitter->Gain = 5.f; + deathSoundEmitter->ReferenceDistance = 1.5f; + + auto deathSoundSystem = m_World->GetSystem("SoundSystem"); + deathSoundSystem->PlaySound(deathSoundEmitter.get(), "Sounds/Explosion3.wav"); + m_World->RemoveEntity(entity); + + //TODO: Ljud som kommer från crashsite } } diff --git a/Escape-the-Dawn/Systems/PlayerSystem.h b/Escape-the-Dawn/Systems/PlayerSystem.h index 5ebd28c..9d37123 100644 --- a/Escape-the-Dawn/Systems/PlayerSystem.h +++ b/Escape-the-Dawn/Systems/PlayerSystem.h @@ -32,7 +32,6 @@ namespace Systems private: float m_PlayerSpeed; glm::vec3 m_PlayerOriginalBounds; - glm::vec3 m_CameraOffset; glm::quat m_CameraOrientation;