I used the code for moving the ground from the Runner Tutorial, but when I run it, the whole ground moves to the rightmost edge instead of just one tile.
Code from tutorial:
local pieces = { "ground0", "ground1", "ground2", "ground3",
"ground4", "ground5", "ground6" }
function init(self)
self.speed = 360
end
function update(self, dt)
for i, p in ipairs(pieces) do
local pos = go.get_position(p)
if pos.x <= -228 then
pos.x = 1368 + (pos.x + 228)
end
pos.x = pos.x - self.speed * dt
go.set_position(pos, p)
end
end