@@ -25,7 +25,7 @@ void SoundSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cComp
|
|||||||
void SoundSystem::Update(double dt)
|
void SoundSystem::Update(double dt)
|
||||||
{
|
{
|
||||||
// Temp for play test.
|
// Temp for play test.
|
||||||
if(m_DrumsIsPlaying) {
|
if (m_DrumsIsPlaying) {
|
||||||
m_DrumsIsPlaying = !drumTimer(dt);
|
m_DrumsIsPlaying = !drumTimer(dt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -69,6 +69,9 @@ bool SoundSystem::OnInputCommand(const Events::InputCommand & e)
|
|||||||
|
|
||||||
void SoundSystem::playerJumps()
|
void SoundSystem::playerJumps()
|
||||||
{
|
{
|
||||||
|
if (!m_LocalPlayer.Valid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
bool grounded = (bool)m_World->GetComponent(m_LocalPlayer.ID, "Physics")["IsOnGround"];
|
bool grounded = (bool)m_World->GetComponent(m_LocalPlayer.ID, "Physics")["IsOnGround"];
|
||||||
if (grounded) {
|
if (grounded) {
|
||||||
Events::PlaySoundOnEntity e;
|
Events::PlaySoundOnEntity e;
|
||||||
@@ -124,11 +127,11 @@ bool SoundSystem::OnPlayerDamage(const Events::PlayerDamage & e)
|
|||||||
std::vector<std::string> paths;
|
std::vector<std::string> paths;
|
||||||
paths.push_back("Audio/hurt/hurt" + std::to_string(rand) + ".wav");
|
paths.push_back("Audio/hurt/hurt" + std::to_string(rand) + ".wav");
|
||||||
|
|
||||||
// // Breathe
|
// // Breathe
|
||||||
// int ammountOfbreaths = (static_cast<int>(e.Damage) / 10) + 2; // TEMP: Idk something stupid like this shit
|
// int ammountOfbreaths = (static_cast<int>(e.Damage) / 10) + 2; // TEMP: Idk something stupid like this shit
|
||||||
// for (int i = 0; i < ammountOfbreaths; i++) {
|
// for (int i = 0; i < ammountOfbreaths; i++) {
|
||||||
// paths.push_back("Audio/exhausted/breath.wav");
|
// paths.push_back("Audio/exhausted/breath.wav");
|
||||||
// }
|
// }
|
||||||
Events::PlayQueueOnEntity ev;
|
Events::PlayQueueOnEntity ev;
|
||||||
ev.Emitter = m_LocalPlayer;
|
ev.Emitter = m_LocalPlayer;
|
||||||
ev.FilePaths = paths;
|
ev.FilePaths = paths;
|
||||||
|
|||||||
Reference in New Issue
Block a user