From 0e1e97da9e8937d19b0101dcc1f3a16e3db495b6 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 6 Feb 2021 21:15:34 -0500 Subject: Added sound and animation changes to scripting --- res/scripts/common.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'res/scripts/common.lua') diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 7e8276f..e7af1cf 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua @@ -21,3 +21,20 @@ function HideCutsceneBars() WaitForEndOfMessage() message():hideCutsceneBars() end + +function SetAnimation(spriteName, animName) + local spriteId = getSpriteByAlias(spriteName) + animation():setSpriteAnimation(spriteId, animName) +end + +function PlaySound(filename) + mixer():playSound("../res/sfx/" .. filename) +end + +function LoopSound(filename) + return mixer():loopSound("../res/sfx/" .. filename) +end + +function StopSound(soundId) + mixer():stopChannel(soundId) +end -- cgit 1.4.1