Adding SoundManager to the game engine
Open the Engine.h
file and add an instance of the new SoundManager
class, as shown in the following highlighted code:
#pragma once #include <SFML/Graphics.hpp> #include "TextureHolder.h" #include "Thomas.h" #include "Bob.h" #include "LevelManager.h" #include "SoundManager.h" using namespace sf; class Engine { private: // The texture holder TextureHolder th; // Thomas and his friend, Bob Thomas m_Thomas; Bob m_Bob; // A class to manage all the levels LevelManager m_LM; // Create a SoundManager SoundManager m_SM; const int TILE_SIZE = 50; const int VERTS_IN_QUAD = 4;
At this point, we could use m_SM
to call the various play...
functions. Unfortunately, there is still a bit more work to be done in order to manage the locations of the emitters (fire tiles).