Jump to content

Tilemap loop


strinh
 Share

Recommended Posts

Hi, im wondering how i loop through a tilemap for an endless runner game, like looping a background.

 

I'm also wondering how i make it so the camera follow the player from the get go (left side) and not start following when the player arrives to the center.

 

So i want to have the tilemap in a loop with the player stationary, to make the map seem infinte.

 

Im testing with a static tilemap and then later add in more tilemaps (or layers) to the mix.

Link to comment
Share on other sites

Yeah, I've been wondering this too. It depends what you want, I think:

 

* Do you just want the tilemap images to scroll past the player? Your best bet might be a TileSprite.

* Do you want the platforms to seem infinite as the player runs along, like Cannabalt? You might be better off making Sprites and colliding them with your player as the player moves. Lots of great tips on making platforms here.

 

As far as the camera goes, the default camera is FOLLOW_LOCKON so I bet the camera is colliding with the world bounds. You could either increase the player's x position until that doesn't happen to the camera anymore or you could set the camera's bounds property to null but there might be side-effects to doing that that I don't know.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...