I'am starting to develop a 2D game with motorbikes.

My Question now is: When my bike reaches the right edge the world should move. (Like in that game: Game example) My first thought was to implement a camera and to create a huge image for the world. (e.g 4096 x 512). So I only have to move the camera to solve the problem.

Is that a good solution?!

Thank your.

Regards, Matthias


What you can do (And what i think many others do) is to split that 4096 into X number of widths (Lets say thats 8 segments of 512.) Then when one of your current background is almost at the end, you can get the next segment ready and position it right next to the previous one.

To add a little more to that, you can also prepare more than just the next segment. So for example, you can keep 3 loaded at one time to keep any edges from showing. So you would have the previous segment, the current one and the next segment loaded.

This is a fairly good way to help reduce the large size of that background. Hope this isn't too confusing. I can whip up some images or code snippets to help if you need.


protected by Community May 15 '14 at 8:40

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.