diff options
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index a3c4c6a..feb1b7f 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -19,6 +19,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +#include "audio.hpp" #include "config.hpp" #include "engine.hpp" #include "gamestate.hpp" @@ -54,6 +55,7 @@ int Engine::init(void) systems.add<ScriptSystem>(entities, *(systems.system<WorldSystem>().get())); systems.add<PhysicsSystem>(); systems.add<TextSystem>(); + systems.add<AudioSystem>(); systems.configure(); // Load game script and entity data @@ -64,6 +66,9 @@ int Engine::init(void) script->addToGameNamespace("puts", bindInstance(&TextSystem::put, systems.system<TextSystem>().get())); + script->addToGameNamespace("play", + bindInstance(&AudioSystem::playSound, + systems.system<AudioSystem>().get())); script->init(); @@ -115,6 +120,7 @@ void Engine::logicLoop(void) }); } + systems.update<AudioSystem>(dt); std::this_thread::yield(); } } |