views:

122

answers:

1

I'm using cocos2d for the iPhone to create an infinitely scrolling horizontal tile map. To achieve this, I've generated a library of 'segments', which are basically horizontal chunks of levels that I randomly choose from and append to the end of that particular levels tile map. When tiles scroll off of the left of the screen they are removed from the layer and released. This all works fine.

My question revolves around the legitimacy of the scrolling method I've chosen. Following guidance from this article, I've been scrolling my map by updating the layers position at regular intervals (subtracting from the x axis to move the layer to the left). And while this works, I'm concerned that there's probably some finite limit to the positioning of a layer. Am I going to run into issues after a certain amount of time has passed (when the layers x-axis position is considerably large?)

Any thoughts on my approach would be appreciated.

A: 

This is a good question. What I would do is run some tests on how far you can position the layer. I placed a sprite and focused the camera to ccp(1000000000000000, 1000000000000000) with no issues.

Do you really think this would be an issue in real gameplay? Seems like it would take a very long game to reach a position like that.

reedjsmith
The world limit is 2^31 as stated by Ricardo Quesada (creator of cocos2d-iphone) in the Google Groups post: http://goo.gl/DuVC
Travis