Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-17-2011, 05:00 AM   #1 (permalink)
almostfunnydev
iPhone Dev SDK Supporter
 
rocotilos's Avatar
 
Join Date: Oct 2009
Age: 34
Posts: 3,015
rocotilos is on a distinguished road
Default Cocos2D Scrolling Method?

Hi Gamemaker Gurus.

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!
rocotilos is offline   Reply With Quote
Old 12-17-2011, 10:27 AM   #2 (permalink)
Registered Member
 
Naughty_Ottsel's Avatar
 
Join Date: Aug 2008
Location: Gillingham, Dorset, UK
Age: 19
Posts: 218
Naughty_Ottsel is on a distinguished road
Send a message via MSN to Naughty_Ottsel
Default

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.
__________________
Follow me on Twitter
Naughty_Ottsel is offline   Reply With Quote
Old 12-17-2011, 08:33 PM   #3 (permalink)
Registered Member
 
dennno's Avatar
 
Join Date: Sep 2011
Posts: 20
dennno is on a distinguished road
Default

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.
dennno is offline   Reply With Quote
Old 12-17-2011, 08:53 PM   #4 (permalink)
almostfunnydev
iPhone Dev SDK Supporter
 
rocotilos's Avatar
 
Join Date: Oct 2009
Age: 34
Posts: 3,015
rocotilos is on a distinguished road
Default

Naughty_Ottsel, yeah... the tutorial i read is also dated looong ago. hehe.

but I am skeptical of the method.

denno, thanks that x ooooooyz thing surely makes more sense. thanks!
rocotilos is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 385
9 members and 376 guests
apatsufas, comicool, Creativ, Dalia, dansparrow, LunarMoon, mer10, Murphy, pbart
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,916
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:02 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0