diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-23 10:30:16 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-23 10:30:16 -0500 |
commit | ae654356f843bb42a3c72d57b528d87aa63cf66d (patch) | |
tree | eea634cf3c6358775bba463a77ce4e2fa6addc7e /res/scripts | |
parent | 1cf3ccd05b193e6090c3a61c0e2f54524e1a4ba7 (diff) | |
download | tanetane-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/scripts')
-rw-r--r-- | res/scripts/common.lua | 16 |
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 | |||
284 | function RemoveExpression(spriteName) | 284 | function RemoveExpression(spriteName) |
285 | DestroyNamedSprite(AliasForSpriteExpression(spriteName)) | 285 | DestroyNamedSprite(AliasForSpriteExpression(spriteName)) |
286 | end | 286 | end |
287 | |||
288 | --- Turns on clipping for the player. | ||
289 | -- This allows walking through solid objects. For debug only! | ||
290 | function StartClipping() | ||
291 | local playerId = getPlayerSprite() | ||
292 | local playerSprite = getSprite(playerId) | ||
293 | playerSprite.clipping = true | ||
294 | end | ||
295 | |||
296 | --- Turns off clipping for the player. | ||
297 | -- For debug only! | ||
298 | function StopClipping() | ||
299 | local playerId = getPlayerSprite() | ||
300 | local playerSprite = getSprite(playerId) | ||
301 | playerSprite.clipping = false | ||
302 | end | ||