diff options
-rw-r--r-- | Scripts/init.lua | 1 | ||||
-rw-r--r-- | src/engine.cpp | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Scripts/init.lua b/Scripts/init.lua index ea5a833..d09fb14 100644 --- a/Scripts/init.lua +++ b/Scripts/init.lua @@ -21,6 +21,7 @@ player = { end, JumpKeyPressed = function(self) if self.Physics.standing == true then + game.play(self.Position, self.Audio) self.Velocity.y = self.Velocity.y + 9 end end, diff --git a/src/engine.cpp b/src/engine.cpp index ed5ba07..c6bec27 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -66,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(); |