diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2019-10-01 20:57:25 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2019-10-01 20:57:25 -0400 |
commit | 9d79ba461a399ce5c211dc7ca2fc49b8934c1cd7 (patch) | |
tree | 23135ab09b6c34c603b9695b77e532ddd3569155 | |
parent | 9b81db1fe44bf13d215cf2700495f2a8710a8ade (diff) |
sound on jump
-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(); |