mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-08 12:00:55 +00:00
full map not needed anymore
This commit is contained in:
@@ -7,16 +7,15 @@
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
float MusicComponent::volume = 0.75;
|
||||
|
||||
MusicComponent::MusicComponent(WAL::Entity &entity, const std::string &musicPath)
|
||||
: WAL::Component(entity),
|
||||
_musicPath(musicPath),
|
||||
_music(RAY::Audio::Music(musicPath))
|
||||
{
|
||||
this->volume = 1;
|
||||
}
|
||||
|
||||
float MusicComponent::volume;
|
||||
|
||||
WAL::Component *MusicComponent::clone(WAL::Entity &entity) const
|
||||
{
|
||||
return new MusicComponent(entity, this->_musicPath);
|
||||
@@ -43,7 +42,8 @@ namespace BBM
|
||||
void MusicComponent::setVolume(float &volumeUpdate)
|
||||
{
|
||||
if (volumeUpdate >= 0) {
|
||||
this->_music.setVolume(volume);
|
||||
this->volume = volumeUpdate;
|
||||
this->_music.setVolume(this->volume);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,26 +7,25 @@
|
||||
#include "SoundComponent.hpp"
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
{
|
||||
float SoundComponent::volume = 0.75;
|
||||
|
||||
SoundComponent::SoundComponent(WAL::Entity &entity, \
|
||||
const std::map<SoundComponent::soundIndex, std::string> &soundPath)
|
||||
: WAL::Component(entity),
|
||||
_soundIndex(IDLE),
|
||||
_soundPath(soundPath)
|
||||
{
|
||||
this->volume = 1;
|
||||
for (int i = 0; i <= DEATH; i++) {
|
||||
if (soundPath.at(static_cast<soundIndex>(i)).empty()) {
|
||||
this->_isLoad[static_cast<soundIndex>(i)] = false;
|
||||
} else {
|
||||
this->_isLoad[static_cast<soundIndex>(i)] = true;
|
||||
this->_soundList[static_cast<soundIndex>(i)] = std::make_unique<RAY::Audio::Sound>(soundPath.at(static_cast<soundIndex>(i)));
|
||||
}
|
||||
this->_isLoad[static_cast<soundIndex>(i)] = false;
|
||||
}
|
||||
for (auto &soundPath : soundPath)
|
||||
{
|
||||
this->_isLoad[soundPath.first] = true;
|
||||
this->_soundList[soundPath.first] = std::make_unique<RAY::Audio::Sound>(soundPath.second);
|
||||
}
|
||||
}
|
||||
|
||||
float SoundComponent::volume;
|
||||
|
||||
WAL::Component *SoundComponent::clone(WAL::Entity &entity) const
|
||||
{
|
||||
return new SoundComponent(entity, this->_soundPath);
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace BBM
|
||||
|
||||
void enableRaylib(WAL::Wal &wal)
|
||||
{
|
||||
//RAY::TraceLog::setLevel(LOG_WARNING);
|
||||
RAY::TraceLog::setLevel(LOG_WARNING);
|
||||
RAY::Window &window = RAY::Window::getInstance(600, 400, "Bomberman", FLAG_WINDOW_RESIZABLE);
|
||||
wal.addSystem<AnimationsSystem>()
|
||||
.addSystem<AnimatorSystem>()
|
||||
@@ -78,12 +78,8 @@ namespace BBM
|
||||
{
|
||||
auto scene = std::make_shared<WAL::Scene>();
|
||||
std::map<SoundComponent::soundIndex, std::string> soundPath= {
|
||||
{SoundComponent::IDLE, ""},
|
||||
{SoundComponent::JUMP, "assets/sounds/jump.wav"},
|
||||
{SoundComponent::BOMB, "assets/sounds/bomb_drop.ogg"},
|
||||
{SoundComponent::MOVE, "assets/sounds/jump.wav"},
|
||||
{SoundComponent::HURT, ""},
|
||||
{SoundComponent::THROW, ""},
|
||||
{SoundComponent::DEATH, "assets/sounds/death.ogg"}
|
||||
};
|
||||
scene->addEntity("player")
|
||||
|
||||
Reference in New Issue
Block a user