I made my first 2 games using plain old XCode/UIImageViews as sprites/NSTimer and a lot of maths. It was tiring to code them. So I am now ready to jump into cocos2d. I have read some tutorials for a few hours and I think I can start making a game now.
However, I am wondering what's the easiest way to make a background scrolling like in Tiny Wings (for example). For my next game, I'd like to have such characteristics, whereby the character is not moving, but on the background scrolls infinitely.
So, there is one example, using 2 CCSprites and sort of moving them one after the other. This is simple, but I get a feeling that the FPS will suffer at slower devices? Or is that way OK to go?
Hope the many gamemaker gurus here can help me on this issue thanks!
A looooong time ago I had did the 2 sprites and moving, its not that bad on older devices, this was running quite smoothly on an iPod Touch G1.
I simply used a moveTo method, which if I remember rightly allows a method to be called when it has finished moving, all that method did was move the sprite back to the beginning and start again.
I've created a simple app like this as a proof of concept and performance is acceptable on 3G devices and older iPod Touches. You just have to make sure to remove the parts of the image that you're not using.
There's plenty of ways to do it, but you could try splitting your background or maps (i'll call your world maps, using TMX maps) into smaller sections and removing certain sections from memory once the character has run past it. So essentially you'll have
x oooooooooooo y z
o - is the visible area on the iphone screen
x - is the part you remove
y - is the part you reveal
z - is the part that replaces y, once it enters the o
Sorry for the diagram but hopefully it makes some sense.
This applies for maybe the 'hills' on tiny wings (example). Which I refer to as the 'middleground'. The background is actually simpler, if you look at Monster Dash, the background moves but very slowly. So you can simple place maybe a 600x320 image (example only) and scroll it slowly until it reaches the end of that stage. For infinite stages, you can just create patterned graphics similar to what I described above.