I got a tiledmap to work where the hero runs to the end of the map, jumping or climbing to avoid physical obstacles, hits a door, and goes into the next level.
Can I use the same method but instead of going into the next level, the tiledmap restarts from the beginning to have the hero running endlessly with a continuous endless background? I tried resetting the X-coord to the beginning, but that only re-displays the graphics, and all of my physical bodies are all messed up not aligned with my graphics.
Is there a better way to do this type of game?
if self.started then
if self.hero.moving then
-- at the end of map: stop world moving
if self.map:getX() < -2400 then
self.hero.moving = false
-- moving map(x, y)
self.frame = 0
self.frame = self.frame + 1
world:step(1.5/60, 8, 3)