Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

protected by Community May 15 at 8:40

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

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.