summary refs log tree commit diff stats
path: root/res
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-23 10:30:16 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-23 10:30:16 -0500
commitae654356f843bb42a3c72d57b528d87aa63cf66d (patch)
treeeea634cf3c6358775bba463a77ce4e2fa6addc7e /res
parent1cf3ccd05b193e6090c3a61c0e2f54524e1a4ba7 (diff)
downloadtanetane-ae654356f843bb42a3c72d57b528d87aa63cf66d.tar.gz
tanetane-ae654356f843bb42a3c72d57b528d87aa63cf66d.tar.bz2
tanetane-ae654356f843bb42a3c72d57b528d87aa63cf66d.zip
Added a clipping mode (for testing!)
This allows walking through solid objects. It can be enabled and disabled using StartClipping() and StopClipping() in the debug console. It should not be used in any actual scripts.
Diffstat (limited to 'res')
-rw-r--r--res/scripts/common.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 45b596d..af25333 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua
@@ -284,3 +284,19 @@ end
284function RemoveExpression(spriteName) 284function RemoveExpression(spriteName)
285 DestroyNamedSprite(AliasForSpriteExpression(spriteName)) 285 DestroyNamedSprite(AliasForSpriteExpression(spriteName))
286end 286end
287
288--- Turns on clipping for the player.
289-- This allows walking through solid objects. For debug only!
290function StartClipping()
291 local playerId = getPlayerSprite()
292 local playerSprite = getSprite(playerId)
293 playerSprite.clipping = true
294end
295
296--- Turns off clipping for the player.
297-- For debug only!
298function StopClipping()
299 local playerId = getPlayerSprite()
300 local playerSprite = getSprite(playerId)
301 playerSprite.clipping = false
302end