From a88b30dd9fd6c6ecf0a8b2f020a63ed3d084488c Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 18 Apr 2021 10:09:50 +0200 Subject: [PATCH] feat: add a way to get the terrain at a point --- sonic-radiance.love/scenes/overworld/map.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sonic-radiance.love/scenes/overworld/map.lua b/sonic-radiance.love/scenes/overworld/map.lua index 824f64b..6567707 100644 --- a/sonic-radiance.love/scenes/overworld/map.lua +++ b/sonic-radiance.love/scenes/overworld/map.lua @@ -95,6 +95,13 @@ end -- TILE FUNCTIONS -- Get tiles +function TiledMultiMap:getTileTypeAtPoint(x, y) + local wrapper = self:getMapAtPoint(x, y) + if (wrapper ~= nil) then + return wrapper:getTileTypeAtPoint(x, y) + end +end + function TiledMultiMap:haveTileTypeInRect(x, y, w, h, type) local listWrapper = self:getMapsInRect(x, y, w, h) for i, wrapper in ipairs(listWrapper) do