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 Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-23-2011, 08:49 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 21
Adil_96 is on a distinguished road
Default cocos2d platformer

Hello developers!
I am currently working on a platformer with my friend, and we are using cocos2d. Now we are doing in-game art. I just want help on how we can set the code to generate platforms with a specified range of distances between them. It is also a running man, so I will need help on that. All the tutorials I saw show a fixed map and a still object. Please help me.
Adil_96 is offline   Reply With Quote
Old 08-23-2011, 09:51 AM   #2 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 194
mavrik5150 is on a distinguished road
Default

You should really be asking this question at the Cocos2d Forum instead of here, that's why they have the forum there. As far as the "running man" statement are you referring to how to animate a sprite in Cocos2d? If so you can check out the tutorials by Ray Wenderlich (How To Use Animations and Sprite Sheets in Cocos2D | Ray Wenderlich) to get the basic idea.

As for the actual platforms, there are several ways you could do this but one of the easy ways is to use LevelHelper (it's like 12 bucks) which allows you to design your level visually and then ports over the necessary code for Cocos2d.
mavrik5150 is offline   Reply With Quote
Old 08-23-2011, 11:50 AM   #3 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 21
Adil_96 is on a distinguished road
Default

Quote:
Originally Posted by mavrik5150 View Post
You should really be asking this question at the Cocos2d Forum instead of here, that's why they have the forum there. As far as the "running man" statement are you referring to how to animate a sprite in Cocos2d? If so you can check out the tutorials by Ray Wenderlich (How To Use Animations and Sprite Sheets in Cocos2D | Ray Wenderlich) to get the basic idea.

As for the actual platforms, there are several ways you could do this but one of the easy ways is to use LevelHelper (it's like 12 bucks) which allows you to design your level visually and then ports over the necessary code for Cocos2d.
Yeah, ok sorry for the wrong place, but our pockets are relatively shallow. We only have money for the iOS developer program. So I just need to know how to generate those platforms because I want it to never end. And thank you for the quick reply, I didn't even have to bump it http://www.iphonedevsdk.com/forum/im...ies/tongue.gif
Adil_96 is offline   Reply With Quote
Old 08-23-2011, 12:00 PM   #4 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

Probably you should create an editor where you can create your levels (i don't think you want to design a level programmatically)....

The editor can be "in-game" where you will develop something to select a type of platform and put it in a x,y then you will export the level as json or xml or a custom format.....and then you need to write the parser to start from the textual representation of the level and re-create it programmatically.
__________________
dany_dev is offline   Reply With Quote
Old 08-23-2011, 12:32 PM   #5 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 194
mavrik5150 is on a distinguished road
Default

Quote:
Originally Posted by Adil_96 View Post
Yeah, ok sorry for the wrong place, but our pockets are relatively shallow. We only have money for the iOS developer program. So I just need to know how to generate those platforms because I want it to never end. And thank you for the quick reply, I didn't even have to bump it http://www.iphonedevsdk.com/forum/im...ies/tongue.gif
Ray also has a Tutorial on his site to make a "Tiny Wings" type of game in which a never ending set of textured hills will be presented. I know it's not exactly what you are looking for but could have enough information to get you going in the right direction.
mavrik5150 is offline   Reply With Quote
Old 08-23-2011, 02:01 PM   #6 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 21
Adil_96 is on a distinguished road
Default

Quote:
Originally Posted by mavrik5150 View Post
Ray also has a Tutorial on his site to make a "Tiny Wings" type of game in which a never ending set of textured hills will be presented. I know it's not exactly what you are looking for but could have enough information to get you going in the right direction.
I'm kind of a noob and don't know that stuff. It shows on setting points for te hill. I just want to know for the origin of the platforms. Sorry for my incompetence, it is our first app on cocos2d.
Adil_96 is offline   Reply With Quote
Old 08-23-2011, 02:09 PM   #7 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 241
MattW is on a distinguished road
Default

Quote:
Originally Posted by Adil_96 View Post
I'm kind of a noob and don't know that stuff. It shows on setting points for te hill. I just want to know for the origin of the platforms. Sorry for my incompetence, it is our first app on cocos2d.
You might want to learn the basics of programming before attempting something complex like a game. Work through the beginner tutorials and get familiar with the language, the tools, and the operating system.

It's the old adage of "learn to walk before you run".
__________________

Highlight PDF text like no other app: iHighlight (now available for iPad and iPhone!)
-----
Create iPhone lists with no typing: Insta-List
-----
Make spelling fun, and create your own tests: iWillSpell
-----
A fast, elegant flashlight app: Insta-Light
-----


FourSixteen Productions
MattW is offline   Reply With Quote
Old 08-23-2011, 02:13 PM   #8 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 21
Adil_96 is on a distinguished road
Default

Quote:
Originally Posted by MattW View Post
You might want to learn the basics of programming before attempting something complex like a game. Work through the beginner tutorials and get familiar with the language, the tools, and the operating system.

It's the old adage of "learn to walk before you run".
Yeah, I have been taking tutorials. But when it comes to this, I am blank
Adil_96 is offline   Reply With Quote
Old 08-23-2011, 02:21 PM   #9 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 241
MattW is on a distinguished road
Default

Quote:
Originally Posted by Adil_96 View Post
Yeah, I have been taking tutorials. But when it comes to this, I am blank
Programming isn't easy - it takes time, patience, and practice to become good at it, and just because Apple have made it easy to download their SDK and tools, that doesn't mean you'll suddenly be able to write a 2D platforming game.

You have to start with the basics... a 'hello world' type app, and gradually build yourself up from there, eventually getting up to speed on OpenGL. I don't mean to be a Negative Nancy, but if you're starting with absolutely zero knowledge of programming, it's going to be quite a while until you're at a level to be able to tackle a platformer.
__________________

Highlight PDF text like no other app: iHighlight (now available for iPad and iPhone!)
-----
Create iPhone lists with no typing: Insta-List
-----
Make spelling fun, and create your own tests: iWillSpell
-----
A fast, elegant flashlight app: Insta-Light
-----


FourSixteen Productions
MattW is offline   Reply With Quote
Old 08-23-2011, 02:27 PM   #10 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 194
mavrik5150 is on a distinguished road
Default

Quote:
Originally Posted by MattW View Post
Programming isn't easy - it takes time, patience, and practice to become good at it, and just because Apple have made it easy to download their SDK and tools, that doesn't mean you'll suddenly be able to write a 2D platforming game.

You have to start with the basics... a 'hello world' type app, and gradually build yourself up from there, eventually getting up to speed on OpenGL. I don't mean to be a Negative Nancy, but if you're starting with absolutely zero knowledge of programming, it's going to be quite a while until you're at a level to be able to tackle a platformer.
Matt his the nail on this one, since you are new to Cocos2D you're going to need to spend some time going through multiple tutorials before you're going to be able understand how to do any of what you are asking. Creating platforms in a random location off screen while the character moves towards them isn't generally that hard, but without some general knowledge on this you're going to get stuck. For example, let just say you have your Platform Sprite added to the project, you could just add the sprite to any X,Y coordinate off screen, maybe using some math to adjust how far apart they should be and make sure they don't go off screen but all of that type of stuff is covered in the tutorials by Ray. They may not be exactly what you want to do, but they show those types of methods (for example what I just listed above can be found in his example on making a game fighting ninja's that come from one side of the screen and move to another, but it shows how to create a sprite in a random location). You're not going to find any tutorial that pins down exactly what you want but once you learn from following several tutorials you will have the knowledge to then pursue what you want in your game.
mavrik5150 is offline   Reply With Quote
Reply

Bookmarks

Tags
cocos2d

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: 400
13 members and 387 guests
7twenty7, cristofercolmbos, dedeys78, fiftysixty, gmarro, iOS.Lover, jonathandeknudt, Matrix23, raymng, stanny, tymex, UMAD, xerohuang
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

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