From 73c9b0fb4eb35e73d0005f896462e748a207d2b1 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 13 Feb 2021 22:32:21 -0500 Subject: Added sfx to electrocution event --- res/scripts/common.lua | 6 ++++++ res/scripts/map2.lua | 4 ++++ res/sfx/lightning_crackle.wav | Bin 0 -> 266072 bytes res/sfx/lightning_explosion.wav | Bin 0 -> 509418 bytes res/sprites/lucas_anim.txt | 2 +- 5 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 res/sfx/lightning_crackle.wav create mode 100644 res/sfx/lightning_explosion.wav (limited to 'res') diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 04f6c5a..75b86a8 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua @@ -30,6 +30,12 @@ SpriteLayer = { ABOVE = 1 } +function Delay(time) + while time > 0 do + time = time - coroutine.yield() + end +end + function StartCutscene() local playerId = getPlayerSprite() local playerSprite = getSprite(playerId) diff --git a/res/scripts/map2.lua b/res/scripts/map2.lua index 1ef1235..8058aa2 100644 --- a/res/scripts/map2.lua +++ b/res/scripts/map2.lua @@ -29,9 +29,13 @@ function map2.mailbox_lightning() DisplayMessage("* ...?", "", SpeakerType.NONE) WaitForEndOfMessage() + PlaySound("lightning_crackle.wav") + Delay(1196) + local lucasPos = GetPosition("lucas") CreateAnimatedSpriteAtPosition("lightning_from_mailbox", "lightning", lucasPos:x() + 56, lucasPos:y() - 72, "strike", Direction.DOWN_LEFT, SpriteLayer.ABOVE) + PlaySound("lightning_explosion.wav") SetDirection("lucas", Direction.DOWN) SetAnimation("lucas", "lightning_electrocute!") WaitForAnimation("lucas") diff --git a/res/sfx/lightning_crackle.wav b/res/sfx/lightning_crackle.wav new file mode 100644 index 0000000..dba4683 Binary files /dev/null and b/res/sfx/lightning_crackle.wav differ diff --git a/res/sfx/lightning_explosion.wav b/res/sfx/lightning_explosion.wav new file mode 100644 index 0000000..0c45636 Binary files /dev/null and b/res/sfx/lightning_explosion.wav differ diff --git a/res/sprites/lucas_anim.txt b/res/sprites/lucas_anim.txt index d03e213..10a4521 100644 --- a/res/sprites/lucas_anim.txt +++ b/res/sprites/lucas_anim.txt @@ -32,5 +32,5 @@ run[up]: 71,79,87,95 run[up_right]: 72,80,88,96 run[right]: 73,81,89,97 run[down_right]: 74,82,90,98 -lightning_electrocute![down]: 116,117,118,116,117,118,116,117,118,116 +lightning_electrocute![down]: 116,117,118,116,117,118 lightning_collapse![down]: 119,120,121,122 \ No newline at end of file -- cgit 1.4.1