Gossage de musique
This commit is contained in:
parent
c176fddea1
commit
5b0be2d985
@ -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();
|
||||
|
@ -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() {
|
||||
|
@ -36,7 +36,7 @@ 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) {
|
||||
@ -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").
|
||||
|
@ -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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user