Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Can I use tiledMap for an endless background game? - Gideros Forum

Can I use tiledMap for an endless background game?

dangkhoadangkhoa Member
edited September 2017 in General questions
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?

function Level:onEnterFrame()
if self.started then
if self.hero.moving then
-- at the end of map: stop world moving
print (self.map:getX())
if self.map:getX() < -2400 then
-- self.map:setX(-240)
self.hero.moving = false
-- moving map(x, y)
self.map:move(-3, 0)
self.frame = 0
self.frame = self.frame + 1
world:step(1.5/60, 8, 3)


Sign In or Register to comment.