Boss fight sounds. bgm, boss-hit, init roar

This commit is contained in:
Stiffly
2015-10-21 15:42:11 +02:00
parent d0668effea
commit 59dbe97191
12 changed files with 40 additions and 4 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -144,7 +144,7 @@ private:
bool m_Pause = false;
int m_LooseBricks = 0;
int m_CurrentCluster = 1;
int m_CurrentLevel = 1;
int m_CurrentLevel = 5;
int m_MultiBalls = 0;
int m_PowerUps = 0;
int m_Score = 0;
+4
View File
@@ -20,6 +20,7 @@
#include "Physics/ECreateParticleSequence.h"
#include "Physics/EContact.h"
#include "Game/EGameStart.h"
#include "Game/EKrakenAppear.h"
namespace dd
@@ -42,6 +43,7 @@ private:
const std::string GAME_BGM = "Sounds/BGM/under-the-sea-n.wav";
const std::string WATER_BGM = "Sounds/BGM/water-flowing.wav";
const std::string STORY_VOICE = "Sounds/jap-story.wav";
const std::string BOSS_BGM = "Sounds/BGM/boss-fight.wav";
float m_BGMMasterVolume = 1.f;
float m_SFXMasterVolume = 1.f;
@@ -62,6 +64,8 @@ private:
bool OnMasterVolume(const dd::Events::MasterVolume &event);
dd::EventRelay<SoundSystem, dd::Events::GameStart> m_EGameStart;
bool OnGameStart(const dd::Events::GameStart &event);
dd::EventRelay <SoundSystem, dd::Events::KrakenAppear> m_EKrakenAppear;
bool OnKrakenAppear(const dd::Events::KrakenAppear &event);
ALuint CreateSource();
+1 -1
View File
@@ -40,7 +40,7 @@ void dd::Systems::KrakenSystem::Initialize()
transform->Position = glm::vec3(50, 50, -10);
//sound
auto collisionSound = m_World->AddComponent<Components::CollisionSound>(ent);
collisionSound->FilePath = "Sounds/Brick/LTTP_Boss_Hit.wav";
collisionSound->FilePath = "Sounds/Boss/boss-hit.wav";
m_World->CommitEntity(ent);
m_KrakenTemplate = ent;
+1 -1
View File
@@ -238,7 +238,7 @@ void dd::Systems::LevelSystem::Initialize()
transform->Position = glm::vec3(50, 50, -10);
//sound
auto collisionSound = m_World->AddComponent<Components::CollisionSound>(m_BrickTemplate);
collisionSound->FilePath = "Sounds/Brick/shortbrickbreak.wav";
collisionSound->FilePath = "Sounds/Brick/brick-hit.wav";
m_World->CommitEntity(m_BrickTemplate);
return;
}
+5 -1
View File
@@ -845,18 +845,23 @@ bool dd::Systems::PhysicsSystem::OnContact(const dd::Events::Contact &event)
if (PowerFriend) {
se.FilePath = "Sounds/jap-awesome.wav";
EventBroker->Publish(se);
e.SpriteFile = "Textures/PowerUps/Friends.png";
} else if (PowerSaviour) {
se.FilePath = "Sounds/jap-awesome.wav";
EventBroker->Publish(se);
e.SpriteFile = "Textures/PowerUps/Saviour.png";
} else if (PowerSticky) {
se.FilePath = "Sounds/jap-awesome.wav";
EventBroker->Publish(se);
e.SpriteFile = "Textures/PowerUps/Sticky.png";
} else if (PowerInkBlaster){
se.FilePath = "Sounds/jap-awesome.wav";
EventBroker->Publish(se);
e.SpriteFile = "Textures/PowerUps/InkBlaster.png";
} else if (PowerKraken) {
se.FilePath = "Sounds/jap-awesome.wav";
EventBroker->Publish(se);
e.SpriteFile = "Textures/PowerUps/RealeaseTheKraken.png";
}
else {
@@ -879,7 +884,6 @@ bool dd::Systems::PhysicsSystem::OnContact(const dd::Events::Contact &event)
}
EventBroker->Publish(e);
EventBroker->Publish(se);
return true;
+28
View File
@@ -40,6 +40,7 @@ void dd::Systems::SoundSystem::Initialize()
EVENT_SUBSCRIBE_MEMBER(m_EStopSound, &SoundSystem::OnStopSound);
EVENT_SUBSCRIBE_MEMBER(m_EMasterVolume, &SoundSystem::OnMasterVolume);
EVENT_SUBSCRIBE_MEMBER(m_EGameStart, &SoundSystem::OnGameStart);
EVENT_SUBSCRIBE_MEMBER(m_EKrakenAppear, &SoundSystem::OnKrakenAppear);
m_SFXMasterVolume = ResourceManager::Load<ConfigFile>("Config.ini")->GetValue<float>("Audio.SFXVolume", 1.f);
m_BGMMasterVolume = ResourceManager::Load<ConfigFile>("Config.ini")->GetValue<float>("Audio.BGMVolume", 1.f);
@@ -214,5 +215,32 @@ bool dd::Systems::SoundSystem::OnGameStart(const dd::Events::GameStart &event)
return true;
}
bool dd::Systems::SoundSystem::OnKrakenAppear(const dd::Events::KrakenAppear &event)
{
{
dd::Events::StopSound e;
e.FilePath = GAME_BGM;
EventBroker->Publish(e);
}
{
dd::Events::StopSound e;
e.FilePath = WATER_BGM;
EventBroker->Publish(e);
}
{
dd::Events::PlaySound e;
e.FilePath = BOSS_BGM;
e.IsAmbient = true;
e.Gain = 0.4f;
EventBroker->Publish(e);
}
{
dd::Events::PlaySound e;
e.FilePath = "Sounds/Boss/boss-roar.wav";
EventBroker->Publish(e);
}
return true;
}