From ae654356f843bb42a3c72d57b528d87aa63cf66d Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 23 Feb 2021 10:30:16 -0500 Subject: 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. --- res/scripts/common.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'res/scripts/common.lua') 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 function RemoveExpression(spriteName) DestroyNamedSprite(AliasForSpriteExpression(spriteName)) end + +--- Turns on clipping for the player. +-- This allows walking through solid objects. For debug only! +function StartClipping() + local playerId = getPlayerSprite() + local playerSprite = getSprite(playerId) + playerSprite.clipping = true +end + +--- Turns off clipping for the player. +-- For debug only! +function StopClipping() + local playerId = getPlayerSprite() + local playerSprite = getSprite(playerId) + playerSprite.clipping = false +end -- cgit 1.4.1