Gossage de musique

This commit is contained in:
MarcEricMartel 2023-12-09 16:51:43 -05:00
parent c176fddea1
commit 5b0be2d985
4 changed files with 11 additions and 7 deletions

View File

@ -302,7 +302,7 @@ void Server::Run() {
for (auto& bull : conn->Bullets) {
bullets.emplace_back(bull);
Log("POW!", false, false);
//Log("POW!", false, false);
BulletAdd* nbul = new BulletAdd();
nbul->pos = bull->getPos();
nbul->dir = bull->getVel();

View File

@ -14,7 +14,7 @@ Audio::Audio(const char * music) {
m_engine->setRolloffFactor(2);
m_engine->setDefault3DSoundMinDistance(.1);
m_engine->setDefault3DSoundMaxDistance(1000);
m_music = m_engine->play2D(music, false, true, true, irrklang::ESM_STREAMING);
m_music = m_engine->play2D(music, true, true, true, irrklang::ESM_STREAMING);
}
Audio::~Audio() {

View File

@ -36,8 +36,8 @@ void Engine::Init() {
// Objet de skybox avec sa propre texture et son propre shader!
m_skybox.Init(0.2f);
// Objet de musique!
m_audio.ToggleMusicState();
//m_menuaudio.ToggleMusicState();
// Array pour les balles.
for (int x = 0; x < MAX_BULLETS; ++x) {
m_bullets[x] = nullptr;
@ -1236,6 +1236,8 @@ void Engine::Render(float elapsedTime) {
if (StartMultiplayerGame()) {
std::cout << "Starting multiplayer game reached" << std::endl;
m_gamestate = GameState::PLAY;
//m_menuaudio.ToggleMusicState();
m_audio.ToggleMusicState();
m_startTime = std::chrono::high_resolution_clock::now();
}
else {
@ -1672,7 +1674,8 @@ void Engine::KeyPressEvent(unsigned char key) {
else if (m_gamestate == GameState::PAUSE) {
m_gamestate = GameState::PLAY;
}
//Stop();
//m_menuaudio.ToggleMusicState();
m_audio.ToggleMusicState();
break;
case 57: // Space - Sauter
if (!m_keySpace) {
@ -1762,7 +1765,7 @@ void Engine::KeyReleaseEvent(unsigned char key) {
m_keyL = false;
break;
case 12: // M - Toggle music
m_audio.ToggleMusicState();
//m_audio.ToggleMusicState();
break;
case 15:
for (int x = 0; x < MAX_BULLETS; ++x) // Ajouter une balle dans l'array (aussi connu sous le nom de "faire pow pow").

View File

@ -86,7 +86,8 @@ private:
char SimulateKeyboard(unsigned char key);
void HandlePlayerInput(float elapsedTime);
Audio m_audio = Audio(AUDIO_PATH "start.wav");
//udio m_menuaudio = Audio(AUDIO_PATH "menumusic.wav");
Audio m_audio = Audio(AUDIO_PATH "music01.wav");
irrklang::ISound* m_powpow, * m_scream;
irrklang::ISound* m_whoosh[MAX_BULLETS];