billmo Posted November 3, 2015 Share Posted November 3, 2015 Need some help and hoping someone will know an answer. I'm trying to create a tilemap world where if the player continues to walk right, eventually they end up back at the beginning of the stage. Does anyone have any idea how this is accomplished? Link to comment Share on other sites More sharing options...
Skeptron Posted November 3, 2015 Share Posted November 3, 2015 Why not just check the player's coordinates are reset them if greater than world bounds? Guramidev 1 Link to comment Share on other sites More sharing options...
billmo Posted November 3, 2015 Author Share Posted November 3, 2015 Would that result in a seamless transition though in regards to the level background? I would have the camera following the player so I'm just not sure how the actual tilemap's end point would connect back to the tilemap's beginning point. Imagine it as a 2 dimensional view of the earth but unraveled so that it doesn't appear that you're walking on actual circle. Link to comment Share on other sites More sharing options...
chongdashu Posted November 4, 2015 Share Posted November 4, 2015 The easiest way to do that would be to continually append a viewport's width-worth of content at the end of the level each time the player traverses through it.* - - - * - - - * - - - *| | | || P | | |* - - - * - - - * - - - ** - - - * - - - * - - - *| | | || P | | |* - - - * - - - * - - - ** - - - * - - - * - - - *| | | || |P | |* - - - * - - - * - - - * * - - - * - - - * - - - * | | | | | P | | | * - - - * - - - * - - - * | ^ | _ _ _ _ _ _ _ _ _ _ _ _ _| Link to comment Share on other sites More sharing options...
jmp909 Posted November 4, 2015 Share Posted November 4, 2015 are there physics on it? I'm guessing that might be an issue using that approach (although i can't see another viable approach!) Link to comment Share on other sites More sharing options...
billmo Posted November 4, 2015 Author Share Posted November 4, 2015 Hmmm. That does sound like an interesting concept. There are physics on it, but maybe I can worry about that step next. Link to comment Share on other sites More sharing options...
Guramidev Posted November 4, 2015 Share Posted November 4, 2015 I would suggest going the way @Skeptron suggested. If you append map to the end of it, you still need the type of map which will assure seamless transition. Given such map it matters not whether you append the map or reset players position to the symmetric opposite point. This is pretty all you need for this: ...if the player continues to walk right, eventually they end up back at the beginning of the stage... And it is better from the memory usage perspective, than appending the map to the end. Link to comment Share on other sites More sharing options...
Recommended Posts