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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

AppFusion - 6 in 1!
($0.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 03-11-2009, 01:58 PM   #1 (permalink)
New Member
 
Join Date: Nov 2008
Posts: 86
Default Cocos2D questions

Hello *,

I played around with Cocos2D and have to say - I'm pretty impressed. Allthough it seems like there is no real iPhone community? Hard to find any documentation. Ok - I have all those code examples - but I'm new to game developement and it would be great to have a resource (like the XCode documentation) that explains the classes.
Opening cocos2d I found an item (in the target drop-down) called cocos-documentation. Does that help in a way? How can I use it? Is there really no structured documentation for iPhone cocos2D out there (like the one for the python version)?

I found the monocle studios introduction and cocos2d.org - that's it - more or less...
twentythree is offline   Reply With Quote
Old 03-11-2009, 02:53 PM   #2 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 15
Default These are very useful

Quote:
Originally Posted by twentythree View Post
Hello *,

I played around with Cocos2D and have to say - I'm pretty impressed. Allthough it seems like there is no real iPhone community? Hard to find any documentation. Ok - I have all those code examples - but I'm new to game developement and it would be great to have a resource (like the XCode documentation) that explains the classes.
Opening cocos2d I found an item (in the target drop-down) called cocos-documentation. Does that help in a way? How can I use it? Is there really no structured documentation for iPhone cocos2D out there (like the one for the python version)?

I found the monocle studios introduction and cocos2d.org - that's it - more or less...
Hey ! Try these out! It's a great way to get going with his framework:

Notes on Cocos2d iPhone Development @ Irrational Exuberance
Touch Detection in Cocos2d iPhone @ Irrational Exuberance
marcond is offline   Reply With Quote
Old 03-11-2009, 03:21 PM   #3 (permalink)
New Member
 
Join Date: Nov 2008
Posts: 86
Default

Hey marcond - great links - I guess this helps a lot.

Do you know anything about the Cocos2D documentation within the framework? (when opening cocos2D 0.7 with XCode in the project settings drop down there is a target named "cocos2d documentation - what does that mean?)
twentythree is offline   Reply With Quote
Old 03-11-2009, 03:51 PM   #4 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 15
Talking

Quote:
Originally Posted by twentythree View Post
Hey marcond - great links - I guess this helps a lot.

Do you know anything about the Cocos2D documentation within the framework? (when opening cocos2D 0.7 with XCode in the project settings drop down there is a target named "cocos2d documentation - what does that mean?)
Those first two links are what really got me going. But I was also learning Obj-C at the same time, as well as Mac OS X (porting all my useless windows shortcuts )

Sounds like you're after the API: cocos2d for iPhone 0.7.0

I'm not sure why you would set your target to that(Documentation), or why it's an option. As far as I know the target is for choosing which "application" in a given project you'd like to run. Tells the compiler which starting point to use. I have several "apps" in the same project file so I can test individual pieces of functionality quickly by changing the target(s). There are two targets you must change in the Project-> drop down so make sure you set both.

Two other important links
cocos2d-iphone - Google Code official cocos2d iphone page
BestPractices - cocos2d-iphone - cocos2d for iPhone best practices - Google Code Best Practices written by Ricardo

What are you trying to do anyways?
marcond is offline   Reply With Quote
Old 03-11-2009, 04:40 PM   #5 (permalink)
New Member
 
Join Date: Nov 2008
Posts: 86
Default

No idea so far. I finished my first Cocoa-Touch App and studied Obj-C and Cocoa for the last months. I started with GL ES and cocos2D now - to get an overview. I decided that my next app should be a game. No clear plan now - early stage. I really worked a lot with XCode, but to be honest - the cocos2D target thing is kind of overwhelming me. I have no idea what these guys are doing there, or better: how

They have multiple apps in one project? How can you do that? What's the advantage? I need to figure out how they did to fully understand the examples. Some of the code is confusing me (e.g. multiple @implementation blocks in the sprites example. Is this the way it has to be, or is it just because of their multiple target architecture?)

So much to do - so little time. I'll figure it out...
twentythree is offline   Reply With Quote
Old 03-11-2009, 07:20 PM   #6 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 15
Default More stuff!

Quote:
Originally Posted by twentythree View Post
No idea so far. I finished my first Cocoa-Touch App and studied Obj-C and Cocoa for the last months. I started with GL ES and cocos2D now - to get an overview. I decided that my next app should be a game. No clear plan now - early stage. I really worked a lot with XCode, but to be honest - the cocos2D target thing is kind of overwhelming me. I have no idea what these guys are doing there, or better: how

They have multiple apps in one project? How can you do that? What's the advantage? I need to figure out how they did to fully understand the examples. Some of the code is confusing me (e.g. multiple @implementation blocks in the sprites example. Is this the way it has to be, or is it just because of their multiple target architecture?)

So much to do - so little time. I'll figure it out...
Ok, I hear ya! I tripped over some issues just getting their examples to build at first.. If you are a visual studio type of guy, adding multiple targets to to your Xcode project, is like adding multiple Projects inside your visual studio Solution. If you open the cocos2d project it comes with, you'll see a ton! they're all their own "Application", and you can do "Project->New Target..." to create your own! For him having 20 targets(apps)in one project, it was to demonstrate each app, yet keep it bundled in 1 project. It's more useful if you have 1 project that uses a bunch of other projects, less windows. But if you prefer multiple instances of XCode to open each of those projects that's fine too! more a convenience factor than anything lol

To create a cocos2d Iphone projec from scratch, like you were talking about (i need to see things from the start too ), just read this:

Monocle Studios Tutorials - iPhone Development with cocos2d-iphone

He starts from the ground up, and implements a few things even like menu etc.

As for the @Implementation all over the place, check the .h. it's in cocos2d-iphone(top folder)\tests\SpritesDemo.h

If you look at the inheritance, all those @imps (@implements SpriteMove, @implements SpriteRotate) all inherit from SpriteDemo, which if you look at the top, is simply a "Layer". So each one of those things he's implementing, is just a layer, demonstrating the given effect (i think he goes through all/most of the cocos effects)... Then if you look further at the code, he just spawns a new layer, and tells the director to pop out the layer and put a new one in. Run the demo, you'll see what I'm saying

Make sure to do
Project->Set Active Target->SpritesDemo(click it)
Project->Set Active Executable->SpritesDemo
Project->Set Active SDK->Simulator -iPhone whatever version (simulator is important too, or you will get unsigned code compile error.. don't believe it defaults to simulator)

Sorry this was so long, hit me up if you got any more questions
marcond is offline   Reply With Quote
Old 03-11-2009, 07:41 PM   #7 (permalink)
New Member
 
Join Date: Nov 2008
Posts: 86
Default

@marcond:

Many thanks for your detailed explanaition. Very appreciated. I guess I understood the @implementation concept not fully. Never saw this anywhere else before. Ok - I understand the code and I see how it works, I see the inheritance. But what does this mean? Is there a name for it? I mean - this is not subclassing - it's within the same class.

I really have fun with cocos2D - nice to see the first sprites move, scale and rotate. Now I have to read the example code and wait for a unique idea...
twentythree 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: 646
24 members and 622 guests
ADY, BrianSlick, cotzy, Creativ, dacapo, Dattee, e2applets, gbenna, IphoneSdk, iseff, jakerocheleau, Jamarsoft, jbro, JiDai, kampftrinker, linkmx, mashercakes, nimesh_158, Reyna, touchcream, ukneeq, yurikus
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 160,619
Threads: 89,833
Posts: 383,488
Top Poster: BrianSlick (7,243)
Welcome to our newest member, yurikus
Powered by vBadvanced CMPS v3.1.0

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