diff --git a/assets/Sounds/jap-awesome.wav b/assets/Sounds/jap-awesome.wav new file mode 100644 index 0000000..587bd27 Binary files /dev/null and b/assets/Sounds/jap-awesome.wav differ diff --git a/include/Physics/PhysicsSystem.h b/include/Physics/PhysicsSystem.h index 04379e4..c01c896 100755 --- a/include/Physics/PhysicsSystem.h +++ b/include/Physics/PhysicsSystem.h @@ -42,6 +42,8 @@ #include "Rendering/CSprite.h" #include "Rendering/CModel.h" +#include "Sound/EPlaySound.h" + namespace dd { diff --git a/src/game/Physics/PhysicsSystem.cpp b/src/game/Physics/PhysicsSystem.cpp index dec9590..ce67687 100755 --- a/src/game/Physics/PhysicsSystem.cpp +++ b/src/game/Physics/PhysicsSystem.cpp @@ -820,6 +820,7 @@ bool dd::Systems::PhysicsSystem::OnContact(const dd::Events::Contact &event) model = m_World->GetComponent(event.Entity1); } + Events::PlaySound se; //Spawn a particle when a brick collides with somthing Events::CreateParticleSequence e; @@ -843,14 +844,19 @@ bool dd::Systems::PhysicsSystem::OnContact(const dd::Events::Contact &event) auto PowerKraken = m_World->GetComponent(entity); if (PowerFriend) { + se.FilePath = "Sounds/jap-awesome.wav"; e.SpriteFile = "Textures/PowerUps/Friends.png"; } else if (PowerSaviour) { + se.FilePath = "Sounds/jap-awesome.wav"; e.SpriteFile = "Textures/PowerUps/Saviour.png"; } else if (PowerSticky) { + se.FilePath = "Sounds/jap-awesome.wav"; e.SpriteFile = "Textures/PowerUps/Sticky.png"; } else if (PowerInkBlaster){ + se.FilePath = "Sounds/jap-awesome.wav"; e.SpriteFile = "Textures/PowerUps/InkBlaster.png"; } else if (PowerKraken) { + se.FilePath = "Sounds/jap-awesome.wav"; e.SpriteFile = "Textures/PowerUps/RealeaseTheKraken.png"; } else { @@ -873,6 +879,7 @@ bool dd::Systems::PhysicsSystem::OnContact(const dd::Events::Contact &event) } EventBroker->Publish(e); + EventBroker->Publish(se); return true;