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.lua9
-rw-r--r--res/scripts/time_passage_antechamber.lua5
2 files changed, 14 insertions, 0 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 8eb491f..1b0c4a9 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua
@@ -313,6 +313,15 @@ function CreateAnimatedSpriteAtPosition(alias, character, x, y, animName, direct
313 animation():setSpriteAnimation(spriteId, animName) 313 animation():setSpriteAnimation(spriteId, animName)
314end 314end
315 315
316function CreateAnimatedSpriteAtWarpPoint(alias, character, warp, animName, direction, layer)
317 local spriteId = emplaceSprite(alias)
318 local loc = getMap():getWarpPoint(warp)
319 transform():initSprite(spriteId, loc:x(), loc:y(), layer)
320 animation():initSprite(spriteId, "../res/sprites/" .. character .. "_anim.txt")
321 animation():setSpriteDirection(spriteId, direction)
322 animation():setSpriteAnimation(spriteId, animName)
323end
324
316function DestroyNamedSprite(alias) 325function DestroyNamedSprite(alias)
317 local spriteId = getSpriteByAlias(alias) 326 local spriteId = getSpriteByAlias(alias)
318 destroySprite(spriteId) 327 destroySprite(spriteId)
diff --git a/res/scripts/time_passage_antechamber.lua b/res/scripts/time_passage_antechamber.lua index d70694a..cd5abbe 100644 --- a/res/scripts/time_passage_antechamber.lua +++ b/res/scripts/time_passage_antechamber.lua
@@ -1 +1,6 @@
1time_passage_antechamber = {} 1time_passage_antechamber = {}
2
3function time_passage_antechamber.enter_door()
4 CreateAnimatedSpriteAtWarpPoint("entryway", "entryway", "entryway_appear", "time_passage", Direction.DOWN, SpriteLayer.NORMAL)
5 ChangeMap("time_passage", "fromBottom")
6end