Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Detect obstacles based on layer properties.
--DETECT OBSTACLES ------------------------------------------------------------
local obstacle = function(level, locX, locY)
local detect = mte.getTileProperties({level = level, locX = locX, locY = locY})
for i = 1, #detect, 1 do
-- I forget why I check the tile property...
if detect[i].tile then
-- does its layers property solid?
if layers[i].properties and layers[i].properties.solid and detect[i].tile > 0 then
detect = "stop"
player:pause()
return detect
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.