this code keeps the circle in place with the world as it scrolls. note you were referencing the wrong object for now (map rather than map.world) so the scrolling broke
[lua]display.setStatusBar( display.HiddenStatusBar )
local lime = require(“lime”)
local tmap = lime.loadMap(“map.tmx”)
local circle = display.newImage(“circle.png”)
tmap:prepare()
local map = tmap.world
local defaultMoveSpeed = 4
local moveSpeed = defaultMoveSpeed
local groundLayer = tmap:getLayer(“Ground”)
groundLayer:insert(circle)
local onUpdate = function(event)
map.x = map.x - moveSpeed
if(moveSpeed > 0 and math.abs(map.x) >= map.width - display.contentWidth) then
moveSpeed = -defaultMoveSpeed
elseif(moveSpeed < 0 and map.x >= map.width - display.contentWidth * 2) then
moveSpeed = defaultMoveSpeed
end
end
local onTouch = function(event)
circle.x = event.x - map.x
circle.y = event.y - map.y
end
Runtime:addEventListener( “touch”, onTouch )
Runtime:addEventListener( “enterFrame”, onUpdate )[/lua] [import]uid: 6645 topic_id: 3534 reply_id: 10899[/import]