diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-13 12:14:58 -0500 | 
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-13 12:14:58 -0500 | 
| commit | ed933607765a6e010689aaaf85184053ff6e8a2b (patch) | |
| tree | 9c59ddfa9c7ddb221788485ad96cad116f8b0c28 /res/scripts/common.lua | |
| parent | e9602acecd1c5f63c6cf72a270a1bd09eba1e7e1 (diff) | |
| download | tanetane-ed933607765a6e010689aaaf85184053ff6e8a2b.tar.gz tanetane-ed933607765a6e010689aaaf85184053ff6e8a2b.tar.bz2 tanetane-ed933607765a6e010689aaaf85184053ff6e8a2b.zip  | |
Added non-looping animations
Lucas can get electrocuted now.
Diffstat (limited to 'res/scripts/common.lua')
| -rw-r--r-- | res/scripts/common.lua | 13 | 
1 files changed, 13 insertions, 0 deletions
| diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 3c412c6..3db1b26 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua | |||
| @@ -59,11 +59,24 @@ function HideCutsceneBars() | |||
| 59 | playerSprite.controllable = true | 59 | playerSprite.controllable = true | 
| 60 | end | 60 | end | 
| 61 | 61 | ||
| 62 | function SetDirection(spriteName, dir) | ||
| 63 | local spriteId = getSpriteByAlias(spriteName) | ||
| 64 | animation():setSpriteDirection(spriteId, dir) | ||
| 65 | end | ||
| 66 | |||
| 62 | function SetAnimation(spriteName, animName) | 67 | function SetAnimation(spriteName, animName) | 
| 63 | local spriteId = getSpriteByAlias(spriteName) | 68 | local spriteId = getSpriteByAlias(spriteName) | 
| 64 | animation():setSpriteAnimation(spriteId, animName) | 69 | animation():setSpriteAnimation(spriteId, animName) | 
| 65 | end | 70 | end | 
| 66 | 71 | ||
| 72 | function WaitForAnimation(spriteName) | ||
| 73 | local spriteId = getSpriteByAlias(spriteName) | ||
| 74 | local sprite = getSprite(spriteId) | ||
| 75 | repeat | ||
| 76 | coroutine.yield() | ||
| 77 | until sprite.animFinished | ||
| 78 | end | ||
| 79 | |||
| 67 | function PlaySound(filename) | 80 | function PlaySound(filename) | 
| 68 | mixer():playSound("../res/sfx/" .. filename) | 81 | mixer():playSound("../res/sfx/" .. filename) | 
| 69 | end | 82 | end | 
