summary refs log tree commit diff stats
path: root/res/scripts/common.lua
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-03-06 23:41:40 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-03-06 23:41:40 -0500
commit6dab458c5fcd97aca871b46a43a2b46c80d1ed3c (patch)
tree84513a99b974000e0845ebf0ff43fa5ab6380c89 /res/scripts/common.lua
parent16a515766862eb69dab70e081170da7ce39602a8 (diff)
downloadtanetane-6dab458c5fcd97aca871b46a43a2b46c80d1ed3c.tar.gz
tanetane-6dab458c5fcd97aca871b46a43a2b46c80d1ed3c.tar.bz2
tanetane-6dab458c5fcd97aca871b46a43a2b46c80d1ed3c.zip
Idling in front of the mirror faces you toward it
Diffstat (limited to 'res/scripts/common.lua')
-rw-r--r--res/scripts/common.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 2a2ce35..d0ea6b5 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua
@@ -542,3 +542,13 @@ function ExitAreaTransition()
542 effect():circleTransition(1, 0.0) 542 effect():circleTransition(1, 0.0)
543 Delay(1000) 543 Delay(1000)
544end 544end
545
546--- Checks whether a sprite is in a zone.
547-- @param spriteName the name of the sprite to locate
548-- @param zoneName the name of the zone on the current map to use as a boundary
549function IsSpriteInZone(spriteName, zoneName)
550 local pos = GetPosition(spriteName)
551 local zone = getMap():getZone(zoneName)
552
553 return (pos:x() >= zone.ul:x()) and (pos:x() <= zone.dr:x()) and (pos:y() >= zone.ul:y()) and (pos:y() <= zone.dr:y())
554end