summary refs log tree commit diff stats
path: root/res
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-16 22:03:10 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-16 22:03:10 -0500
commita645524d19bb9183d4eece72bf8945bba4bed3a0 (patch)
treeca45cb80f73def5bd6bd8d7ec46bb90c826be848 /res
parentc5a96f0ee23a3dbe1a6dab0a1062cf25b7a2aba4 (diff)
downloadtanetane-a645524d19bb9183d4eece72bf8945bba4bed3a0.tar.gz
tanetane-a645524d19bb9183d4eece72bf8945bba4bed3a0.tar.bz2
tanetane-a645524d19bb9183d4eece72bf8945bba4bed3a0.zip
Added scriptable camera panning
Diffstat (limited to 'res')
-rw-r--r--res/scripts/common.lua23
-rw-r--r--res/scripts/map2.lua19
2 files changed, 41 insertions, 1 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index caab86a..f88c4c1 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua
@@ -141,6 +141,29 @@ function StopShakingCamera()
141 effect():stopShakingCamera() 141 effect():stopShakingCamera()
142end 142end
143 143
144function PanToSprite(spriteName, length)
145 local spriteId = getSpriteByAlias(spriteName)
146 camera():panToSprite(spriteId, length)
147end
148
149function WaitForPan()
150 while camera():isPanning() do
151 coroutine.yield()
152 end
153end
154
155function ReturnCamera(length)
156 local playerId = getPlayerSprite()
157 camera():panToSprite(playerId, length)
158
159 while camera():isPanning() do
160 coroutine.yield()
161 end
162
163 camera():setFollowingSprite(playerId)
164 camera():unlockCamera()
165end
166
144function SetPartyDirection(spriteId, direction) 167function SetPartyDirection(spriteId, direction)
145 animation():setSpriteDirection(spriteId, direction) 168 animation():setSpriteDirection(spriteId, direction)
146 169
diff --git a/res/scripts/map2.lua b/res/scripts/map2.lua index 92c1747..c929e8d 100644 --- a/res/scripts/map2.lua +++ b/res/scripts/map2.lua
@@ -74,9 +74,26 @@ function map2.approach_doria()
74 gamestate.approached_doria = true 74 gamestate.approached_doria = true
75 75
76 StartCutscene() 76 StartCutscene()
77 PanToSprite("doria", 2000)
78 WaitForPan()
79
77 SetDirection("doria", Direction.DOWN_RIGHT) 80 SetDirection("doria", Direction.DOWN_RIGHT)
78 SetAnimation("doria", "talk") 81 SetAnimation("doria", "talk")
79 DisplayMessage("* Oh my!\n* Is that our little Kumatora I spy? `\n* Such style! Such swagger!\nWhy, just as if she were Magifolk herself! `\n* When Ionia showed us the human she was looking after, I hardly knew what to think.", "Doria", SpeakerType.MAN) 82 DisplayMessage("* Oh my!\n\f* Is that our little Kumatora I spy? `", "Doria", SpeakerType.MAN)
83 WaitForEndOfMessage()
84
85 SetAnimation("doria", "still")
86 ReturnCamera(2000)
87 Delay(1000)
88 SetAnimation("kuma", "talk")
89 DisplayMessage("* Doria...?\n\f* What the hell... You're still alive?", "Kumatora", SpeakerType.WOMAN)
90 WaitForEndOfMessage()
91
92 SetAnimation("kuma", "still")
93 Delay(1000)
94
95 SetAnimation("doria", "talk")
96 DisplayMessage("* It is! It is her!\n\f* Such style! Such swagger!\nWhy, just as if she were Magifolk herself! `\n* When Ionia showed us the human she was looking after, I hardly knew what to think.", "Doria", SpeakerType.MAN)
80 WaitForEndOfMessage() 97 WaitForEndOfMessage()
81 98
82 SetDirection("doria", Direction.DOWN) 99 SetDirection("doria", Direction.DOWN)