iphonescrollcocos2d-iphone

Cocos2d Side Scrolling Game


Which is the best approach to create a side Scrolling racing game? Should I just move the background or work with the camera instead? I read in lots of places that moving the background is the way to go, but how do I handle the other players? Sorry if this is a noob question but I'm a bit confused.


Solution

  • i think the best way is to set a point in your scene called ancher which doesn't move in your screen but and calculate every other position relative to it. the ancher is moving along side every other player but in a controled manner (for example you can set it in the middle of your track along side with player), in this case you only have to move the background according to your ancher and then you calculate the other positions all relative to the ancher. it may look a bit complicated but implementing this is much more easier and bugfrier than any other method.