summary refs log tree commit diff stats
path: root/res/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'res/scripts')
-rw-r--r--res/scripts/common.lua6
-rw-r--r--res/scripts/map2.lua4
2 files changed, 10 insertions, 0 deletions
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 = {
30 ABOVE = 1 30 ABOVE = 1
31} 31}
32 32
33function Delay(time)
34 while time > 0 do
35 time = time - coroutine.yield()
36 end
37end
38
33function StartCutscene() 39function StartCutscene()
34 local playerId = getPlayerSprite() 40 local playerId = getPlayerSprite()
35 local playerSprite = getSprite(playerId) 41 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()
29 DisplayMessage("* ...?", "", SpeakerType.NONE) 29 DisplayMessage("* ...?", "", SpeakerType.NONE)
30 WaitForEndOfMessage() 30 WaitForEndOfMessage()
31 31
32 PlaySound("lightning_crackle.wav")
33 Delay(1196)
34
32 local lucasPos = GetPosition("lucas") 35 local lucasPos = GetPosition("lucas")
33 CreateAnimatedSpriteAtPosition("lightning_from_mailbox", "lightning", lucasPos:x() + 56, lucasPos:y() - 72, "strike", Direction.DOWN_LEFT, SpriteLayer.ABOVE) 36 CreateAnimatedSpriteAtPosition("lightning_from_mailbox", "lightning", lucasPos:x() + 56, lucasPos:y() - 72, "strike", Direction.DOWN_LEFT, SpriteLayer.ABOVE)
34 37
38 PlaySound("lightning_explosion.wav")
35 SetDirection("lucas", Direction.DOWN) 39 SetDirection("lucas", Direction.DOWN)
36 SetAnimation("lucas", "lightning_electrocute!") 40 SetAnimation("lucas", "lightning_electrocute!")
37 WaitForAnimation("lucas") 41 WaitForAnimation("lucas")