summary refs log tree commit diff stats
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/maps/map2.tmx8
-rw-r--r--res/scripts/common.lua13
-rw-r--r--res/scripts/map2.lua14
-rw-r--r--res/sprites/lucas_anim.txt3
4 files changed, 36 insertions, 2 deletions
diff --git a/res/maps/map2.tmx b/res/maps/map2.tmx index ee9931c..6316ef5 100644 --- a/res/maps/map2.tmx +++ b/res/maps/map2.tmx
@@ -1,5 +1,5 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="64" height="64" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="5"> 2<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="64" height="64" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="6">
3 <tileset firstgid="1" name="fromRom" tilewidth="16" tileheight="16" tilecount="180" columns="10"> 3 <tileset firstgid="1" name="fromRom" tilewidth="16" tileheight="16" tilecount="180" columns="10">
4 <image source="map2_tiles.png" width="160" height="288"/> 4 <image source="map2_tiles.png" width="160" height="288"/>
5 <tile id="61"> 5 <tile id="61">
@@ -651,6 +651,12 @@
651 </properties> 651 </properties>
652 <point/> 652 <point/>
653 </object> 653 </object>
654 <object id="5" name="mailbox_lightning" type="tileSprite" x="519" y="422.667">
655 <properties>
656 <property name="interactionScript" value="mailbox_lightning"/>
657 </properties>
658 <point/>
659 </object>
654 </objectgroup> 660 </objectgroup>
655 <layer id="1" name="Layer 0" width="64" height="64"> 661 <layer id="1" name="Layer 0" width="64" height="64">
656 <data encoding="csv"> 662 <data encoding="csv">
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
60end 60end
61 61
62function SetDirection(spriteName, dir)
63 local spriteId = getSpriteByAlias(spriteName)
64 animation():setSpriteDirection(spriteId, dir)
65end
66
62function SetAnimation(spriteName, animName) 67function SetAnimation(spriteName, animName)
63 local spriteId = getSpriteByAlias(spriteName) 68 local spriteId = getSpriteByAlias(spriteName)
64 animation():setSpriteAnimation(spriteId, animName) 69 animation():setSpriteAnimation(spriteId, animName)
65end 70end
66 71
72function WaitForAnimation(spriteName)
73 local spriteId = getSpriteByAlias(spriteName)
74 local sprite = getSprite(spriteId)
75 repeat
76 coroutine.yield()
77 until sprite.animFinished
78end
79
67function PlaySound(filename) 80function PlaySound(filename)
68 mixer():playSound("../res/sfx/" .. filename) 81 mixer():playSound("../res/sfx/" .. filename)
69end 82end
diff --git a/res/scripts/map2.lua b/res/scripts/map2.lua index 1b55072..3bc9eff 100644 --- a/res/scripts/map2.lua +++ b/res/scripts/map2.lua
@@ -23,3 +23,17 @@ function map2.mailbox1()
23 23
24 HideCutsceneBars() 24 HideCutsceneBars()
25end 25end
26
27function map2.mailbox_lightning()
28 StartCutscene()
29 DisplayMessage("* ...?", "", SpeakerType.NONE)
30 WaitForEndOfMessage()
31
32 SetDirection("lucas", Direction.DOWN)
33 SetAnimation("lucas", "electrocute!")
34 WaitForAnimation("lucas")
35
36 DisplayMessage("* It was lightning.\n\fAh.", "", SpeakerType.NONE)
37 WaitForEndOfMessage()
38 HideCutsceneBars()
39end
diff --git a/res/sprites/lucas_anim.txt b/res/sprites/lucas_anim.txt index 455c321..12a373e 100644 --- a/res/sprites/lucas_anim.txt +++ b/res/sprites/lucas_anim.txt
@@ -31,4 +31,5 @@ run[up_left]: 70,78,86,94
31run[up]: 71,79,87,95 31run[up]: 71,79,87,95
32run[up_right]: 72,80,88,96 32run[up_right]: 72,80,88,96
33run[right]: 73,81,89,97 33run[right]: 73,81,89,97
34run[down_right]: 74,82,90,98 \ No newline at end of file 34run[down_right]: 74,82,90,98
35electrocute![down]: 116,117,118,116,117,118,116,117,118,119,120,121,122 \ No newline at end of file