feat: add a way to get the terrain at a point

This commit is contained in:
Kazhnuz 2021-04-18 10:09:50 +02:00
parent 45fc9005b5
commit a88b30dd9f

View file

@ -95,6 +95,13 @@ end
-- TILE FUNCTIONS -- TILE FUNCTIONS
-- Get tiles -- 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) function TiledMultiMap:haveTileTypeInRect(x, y, w, h, type)
local listWrapper = self:getMapsInRect(x, y, w, h) local listWrapper = self:getMapsInRect(x, y, w, h)
for i, wrapper in ipairs(listWrapper) do for i, wrapper in ipairs(listWrapper) do