From: Clyne Sullivan Date: Wed, 2 Oct 2019 00:57:25 +0000 (-0400) Subject: sound on jump X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=9d79ba461a399ce5c211dc7ca2fc49b8934c1cd7;p=clyne%2Fgamedev2.git sound on jump --- 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().get())); + script->addToGameNamespace("play", + bindInstance(&AudioSystem::playSound, + systems.system().get())); script->init();