I’ve been playing around with Tutorial 13 and I just can’t get it to work. I have tried using the version of Lime you can download from here:
https://github.com/OutlawGameTools/Lime2DTileEngine/zipball/master
and the one you can download from here:
https://github.com/OutlawGameTools/Lime2DTileEngine/archive/master.zip
They both seem to be Lime Version 3.5
This is the code from the tutorial page that just won’t work:
[lua]lime = require(“lime.lime”)
local map = lime.loadMap(“tutorial20.tmx”)
local physical = lime.buildPhysical(map)
local visual = lime.createVisual(map)
local onTap = function(event)
local screenPosition = { x = event.x, y = event.y }
local worldPosition = lime.utils.screenToWorldPosition(map, screenPosition)
– Instantly jump to the new position
map:setPosition(worldPosition.x, worldPosition.y)
– Fade out, set position and then fade back in again
– map:fadeToPosition(worldPosition.x, worldPosition.y, 1000)
– Slide to the new position
– map:slideToPosition(worldPosition.x, worldPosition.y, 2000)
end
Runtime:addEventListener(“tap”, onTap)[/lua]
I’ve attached a screenshot of the error I get. The indication of a problem occurs here:
[lua]
function Utils:screenToWorldPosition(map, position)
local _map = map
local _position = position
local newPosition = {}
if _map.world then
[/lua]
And it appears that _map.world is nil. I’ve tried to print out map by converting it from a table into a series of formatted strings and it doesn’t seem like there is a “world” attribute anywhere in it. I could use a fresh set of eyes or a more experienced opinion on this one.