Quote:
Originally Posted by twentythree
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