From 08fa3cd46e6de0faacc0695b25d187f420e56c61 Mon Sep 17 00:00:00 2001 From: Nyeogmi Date: Fri, 30 Dec 2022 23:38:08 -0800 Subject: [PATCH] Use bit math to keep player from leaving the map --- chameleonic.p8 | 1 + 1 file changed, 1 insertion(+) diff --git a/chameleonic.p8 b/chameleonic.p8 index 83aaa5b..59222a9 100644 --- a/chameleonic.p8 +++ b/chameleonic.p8 @@ -554,6 +554,7 @@ function level:can_move( if (is_player and self:win_at(mx1,my1)) return true if (is_player and self:get_open_pit(mx1,my1)) return wrongbleep:adequately_warned() + if ((mx1 | my1) & 0xFFF0!=0) return false if (self:mcoll(mx1,my1) or player.x==mx1 and player.y==my1) return if player.rope then