fix merge + convert audio ressources + add sounds/music to scenes

This commit is contained in:
arthur.jamet
2021-06-09 15:21:00 +02:00
39 changed files with 900 additions and 268 deletions
@@ -0,0 +1,32 @@
//
// Created by Tom Augier on 05/06/2021
//
#include "MenuSoundManagerSystem.hpp"
#include <map>
namespace BBM {
MenuSoundManagerSystem::MenuSoundManagerSystem(WAL::Wal &wal)
: System(wal)
{}
void MenuSoundManagerSystem::onFixedUpdate(WAL::ViewEntity<SoundComponent, ControllableComponent> &entity)
{
const auto &controllable = entity.get<ControllableComponent>();
auto &sound = entity.get<SoundComponent>();
sound.setVolume(sound.volume);
std::map<bool, SoundComponent::SoundIndex> soundIndex = {
{controllable.move.x, SoundComponent::MOVE},
{controllable.move.y, SoundComponent::MOVE},
{controllable.jump, SoundComponent::JUMP},
};
for (auto &a : soundIndex) {
if (a.first) {
sound.setIndex(a.second);
sound.playSound();
}
}
}
}